When should one use #value_callback and when #element_validate?
#element_validate:


  A list of custom validation functions. The validation functions must use form_error() or form_set_error() to flag the element as having an error if the validation fails.


Use this when you want to validate the input into your custom element, and inform users of any failures. Code example of such a validation function:

function myelement_validate($element, &amp;$form_state, $form) {
   if (empty($element['#value'])) {
     form_error($element, t('This field is required.'));
   }
}


#value_callback:


  Specifies the name of a custom value function that implements how user input is mapped to an element's #value property.


Use this when you simply want to change the state of something in your element based on contextual information. Don't use this method if that state-change has the potential to cause an error that the user should be made aware of; use a validate function in that instance instead.

Code example:

function file_field_widget_value($element, $input = FALSE, $form_state) {
  if ($input) {
    // Checkboxes lose their value when empty.
    // If the display field is present make sure its unchecked value is saved.
    $field = field_widget_field($element, $form_state);
    if (empty($input['display'])) {
      $input['display'] = $field['settings']['display_field'] ? 0 : 1;
    }
  }
}


So to your question:


  when should you go trough the individual inputs and create the SQL connection string from them?


If this is a process that needs to be validated, then in a validation function. If it's something that just needs to be done, regardless of the input, then it goes in the value callback function.

Reading through the code in a bunch of the core value callbacks should clear up the confusion even better:


form_type_select_value()
form_type_textfield_value()
form_type_checkbox_value()


Notice that nothing in any of those functions relates to validation of the input.

Also see form_builder(), where the callback is actually used.