private String buildTableName(DatabaseMetaData dbmd,
        String catalog, String schema, String table) throws SQLException {

       // trim all the leading and trailing whitespaces,
       // white spaces can never be catalog, schema or a table name.

        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.

@param dbmd a <code>DatabaseMetaData</code> object that contains metadata
         about this writer's <code>CachedRowSet</code> object
@param catalog a <code>String</code> object with the rowset's catalog
         name
@param table a <code>String</code> object with the name of the table from
         which this writer's rowset was derived
@return a <code>String</code> object with the fully qualified name of the
         table from which this writer's rowset was derived
@throws SQLException if a database access error occurs
src/main/java/org/replicadb/rowset/sun/rowset/internal/CachedRowSetWriter.java