private String buildTableName(DatabaseMetaData dbmd,String catalog,String schema,String table) throws SQLException {
  String cmd="";
  catalog=catalog.trim();
  schema=schema.trim();
  table=table.trim();
  if (dbmd.isCatalogAtStart() == true) {
    if (catalog != null && catalog.length() > 0) {
      cmd+=catalog + dbmd.getCatalogSeparator();
    }
    if (schema != null && schema.length() > 0) {
      cmd+=schema + ".";
    }
    cmd+=table;
  }
 else {
    if (schema != null && schema.length() > 0) {
      cmd+=schema + ".";
    }
    cmd+=table;
    if (catalog != null && catalog.length() > 0) {
      cmd+=dbmd.getCatalogSeparator() + catalog;
    }
  }
  cmd+=" ";
  return cmd;
}

private String buildTableName ( DatabaseMetaData dbmd , String catalog , String schema , String table ) throws SQLException { String cmd = "" ; catalog = catalog . trim ( ) ; schema = schema . trim ( ) ; table = table . trim ( ) ; if ( dbmd . isCatalogAtStart ( ) == true ) { if ( catalog != null && catalog . length ( ) > 0 ) { cmd += catalog + dbmd . getCatalogSeparator ( ) ; } if ( schema != null && schema . length ( ) > 0 ) { cmd += schema + "." ; } cmd += table ; } else { if ( schema != null && schema . length ( ) > 0 ) { cmd += schema + "." ; } cmd += table ; if ( catalog != null && catalog . length ( ) > 0 ) { cmd += dbmd . getCatalogSeparator ( ) + catalog ; } } cmd += " " ; return cmd ; }
returns a fully qualified table name built from the given catalog and table names . the given metadata object is used to get the proper order and separator .
