protected void applyUseSchema(String schema) throws SQLException {
  boolean schemaSet=false;
  if (schema != null && schema.length() > 0 && !schema.equals(this.currentSchema)) {
    currentSchema=schema;
    if (conn.supportsUseDefaultSchema()) {
      String useQuery=conn.getUseSchemaQuery(schema);
      if (logger.isDebugEnabled()) {
        logger.debug("Setting default schema: " + useQuery);
      }
      statement.addBatch(useQuery);
      schemaSet=true;
    }
  }
  if (!schemaSet) {
    if (logger.isDebugEnabled()) {
      logger.debug("Schema was not set: schema=" + schema + " currentSchema="+ currentSchema);
    }
  }
}

protected void applyUseSchema ( String schema ) throws SQLException { boolean schemaSet = false ; if ( schema != null && schema . length ( ) > 0 && ! schema . equals ( this . currentSchema ) ) { currentSchema = schema ; if ( conn . supportsUseDefaultSchema ( ) ) { String useQuery = conn . getUseSchemaQuery ( schema ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Setting default schema: " + useQuery ) ; } statement . addBatch ( useQuery ) ; schemaSet = true ; } } if ( ! schemaSet ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Schema was not set: schema=" + schema + " currentSchema=" + currentSchema ) ; } } }
applysetuseschema adds to the batch the query used to change the current schema where queries should be executed , if needed and if possible ( if the database support such a feature )
