SolarMetric Kodo JDO 3.1.6 generated on August 25 2004

kodo.jdbc.sql
Class DBDictionary

java.lang.Object
  |
  +--kodo.jdbc.sql.DBDictionary
All Implemented Interfaces:
Configurable, ConnectionDecorator
Direct Known Subclasses:
AbstractSQLServerDictionary, AccessDictionary, CacheDictionary, DB2Dictionary, EmpressDictionary, FoxProDictionary, HSQLDictionary, InformixDictionary, InterbaseDictionary, JDataStoreDictionary, MySQLDictionary, OracleDictionary, PointbaseDictionary, PostgresDictionary

public class DBDictionary
extends Object
implements Configurable, ConnectionDecorator

Class which allows the creation of SQL dynamically, in a database agnostic fashion. Subclass for the nuances of different data stores.


Field Summary
protected static int CENTI
           
protected static int DECI
           
protected static int MICRO
           
protected static int MILLI
           
protected static int NANO
           
static String SCHEMA_CASE_DEFAULT
          Symbolic constant for setSchemaCase that indicates that no changes should be made to the specified schema name.
static String SCHEMA_CASE_LOWER
          Symbolic constant for setSchemaCase that indicates that schema names should always be converted to lower-case.
static String SCHEMA_CASE_PRESERVE
          Symbolic constant for setSchemaCase that indicates that no changes should be made to the specified schema name.
static String SCHEMA_CASE_UPPER
          Symbolic constant for setSchemaCase that indicates that schema names should always be converted to upper-case.
protected static int SEC
           
 
Constructor Summary
DBDictionary()
           
 
Method Summary
 void addSystemSchema(String schemaName)
          Add the name of a schema that should not be reflected on.
 void addSystemTable(String tableName)
          Add the name of a table that should not be reflected on.
protected  void afterMetadataOperation(Connection c)
           
protected  String appendSize(Column col, String typeName)
          Helper method to append the size and decimal digits to the given type name.
 boolean assertSelectForUpdate()
          Returns true if this dictionary supports "SELECT ...
protected  void beforeMetadataOperation(Connection c)
           
 boolean canBatch(Column col)
          Returns type if the specified column can be included in batch statements.
 boolean canLock(Select select)
          Returns true if a "FOR UPDATE" clause can be used for the specified Select object.
 void configureReflectedColumn(Column col, String typeName)
          Configure the specified column with the typeName from the DatabaseMetaData.
protected  String convertSchemaCase(String objectName)
          Convert the specified schema name to a name that the database will be able to understand.
 Connection decorate(Connection conn)
          Decorate the given connection if needed.
 void endConfiguration()
          Invoked upon completion of bean property configuration for this object.
 String[] getAddColumnSQL(Column column)
          Return a series of SQL statements to add the given column to its table.
 String[] getAddForeignKeySQL(ForeignKey fk)
          Return a series of SQL statements to add the given foreign key to its table.
 String[] getAddPrimaryKeySQL(PrimaryKey pk)
          Return a series of SQL statements to add the given primary key to its table.
 Array getArray(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 InputStream getAsciiStream(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getAutoIncrementClause()
           
 String getAutoIncrementTypeName()
           
 int getBatchLimit()
          The maximum number of statements per SQL batch.
 int getBatchParameterLimit()
          The maximum number of parameters that can be batched.
 BigDecimal getBigDecimal(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 BigInteger getBigInteger(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getBigintTypeName()
          The schema definition name for Types.BIGINT.
 InputStream getBinaryStream(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getBinaryTypeName()
          The schema definition name for Types.BINARY.
 String getBitTypeName()
          The schema definition name for Types.BIT.
 Blob getBlob(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 Object getBlobObject(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 InputStream getBlobStream(ResultSet rs, int column)
          Returns an InputStream for the blob data specified in the ResultSet.
 String getBlobTypeName()
          The schema definition name for Types.BLOB.
 boolean getBoolean(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 byte getByte(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 byte[] getBytes(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
protected  String getCatalogNameForMetadata(String catalogName)
          Returns the catalog name that will be used for obtaining information from DatabaseMetaData.
 String getCatalogSeparator()
          Returns the separator String between the schema name and the table name.
 char getChar(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 Reader getCharacterStream(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getCharTypeName()
          The schema definition name for Types.CHAR.
 Clob getClob(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getClobString(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getClobTypeName()
          The schema definition name for Types.CLOB.
protected  String getColumnNameForMetadata(String columnName)
          Returns the column name that will be used for obtaining information from DatabaseMetaData.
 ColumnInfo[] getColumns(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn)
          Return a result set in the form expected by DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String).
 JDBCConfiguration getConfiguration()
          Get the configuration for this dictionary.
protected  boolean getConstraintNameBeforeDeclaration()
          Return whether the name of the constraint should come before or after the constraint declaration.
 String[] getCreateIndexSQL(Index index)
          Return a series of SQL statements to create the given index.
 boolean getCreatePrimaryKeys()
          If false, then do not specify that identifiers are primary keys.
 String[] getCreateTableSQL(Table table)
          Return a series of SQL statements to create the given table, complete with columns.
 Date getDate(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 Date getDate(ResultSet rs, int column, Calendar cal)
          Convert the specified column of the SQL ResultSet to the proper java type.
protected  int getDatePrecision()
          Set to the precision of timestamps in the data store.
 String getDateTypeName()
          The schema definition name for Types.DATE.
 DBMetaData getDBMetaData()
          Return the DBMetaData for this dictionary.
 String getDecimalTypeName()
          The schema definition name for Types.DECIMAL.
protected  String getDeclareColumnSQL(Column col, boolean alter)
          Return the declaration SQL for the given column.
 String getDefaultSchemaName()
          The schema name to use for metadata operations if none is set.
 String getDistinctCountColumnSeparator()
          The separator to use to combine columns in a COUNT(DISTINCT columns) clause, or null if this database does not support multiple distinct entries in a COUNT.
 String getDistinctTypeName()
          The schema definition name for Types.DISTINCT.
 double getDouble(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getDoubleTypeName()
          The schema definition name for Types.DOUBLE.
 String[] getDropColumnSQL(Column column)
          Return a series of SQL statements to drop the given column from its table.
 String[] getDropForeignKeySQL(ForeignKey fk)
          Return a series of SQL statements to drop the given foreign key from its table.
 String[] getDropIndexSQL(Index index)
          Return a series of SQL statements to drop the given index.
 String[] getDropPrimaryKeySQL(PrimaryKey pk)
          Return a series of SQL statements to drop the given primary key from its table.
 String[] getDropTableSQL(Table table)
          Return a series of SQL statements to drop the given table.
 float getFloat(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getFloatTypeName()
          The schema definition name for Types.FLOAT.
protected  String getForeignKeyActionName(int action)
          Return the action SQL for the given foreign key.
protected  String getForeignKeyConstraintSQL(ForeignKey fk)
          Return the declaration SQL for the given foreign key, or null if it is not supported.
 String getForUpdateClause()
          The clause that is used for issuing "SELECT ...
protected  SQLBuffer getFrom(Select sel, boolean forUpdate)
          Return the portion of the select statement between the FROM keyword and the WHERE keyword.
 String getFullName(Index index)
          Returns the full name of the index, including the schema (delimited by the result of getCatalogSeparator()).
 String getFullName(Table table)
          Returns the full name of the table, including the schema (delimited by the result of getCatalogSeparator()).
 String getFullName(Table table, boolean logical)
          Returns the full name of the table, including the schema.
 long getGeneratedKey(Column col, Connection conn)
          Return the last inserted auto increment value for the given column.
protected  String getGeneratedKeySequenceName(Column col)
          Return the sequence name used by databases for the given autoincrement column.
 ForeignKeyInfo[] getImportedKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn)
          Return a result set in the form expected by DatabaseMetaData.getImportedKeys(java.lang.String, java.lang.String, java.lang.String), though only the PKTABLE_SCHEM, PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_SCHEM, FKTABLE_NAME, FKCOLUMN_NAME, KEY_SEQ, DELETE_RULE, FK_NAME, DEFERRABILITY columns are required.
 IndexInfo[] getIndexInfo(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique, boolean approx, Connection conn)
          Return a result set in the form expected by DatabaseMetaData.getIndexInfo(java.lang.String, java.lang.String, java.lang.String, boolean, boolean), though only the TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, INDEX_NAME, COLUMN_NAME columns are required.
 String getInitializationSQL()
          SQL that will be issued to the database whenever a connection is made.
 int getInt(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getIntegerTypeName()
          The schema definition name for Types.INTEGER.
 String getJavaObjectTypeName()
          The schema definition name for Types.JAVA_OBJECT.
 int getJDBCType(int metaTypeCode, boolean lob)
          Return the preferred Types constant for the given FieldMapping constant.
 String getJoinSyntax()
          The join syntax to use as a string for automatic configuration: sql92, traditional, database
 int getJoinSyntaxConstant()
          The SQL join syntax to use as one of the Join syntax constants.
 String getLastGeneratedKeyQuery()
          The query that will be used to query the last automatically generated key on the server.
 String getLastGeneratedKeyQuery(Column column)
           
 Locale getLocale(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 long getLong(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getLongVarbinaryTypeName()
          The schema definition name for Types.LONGVARBINARY.
 String getLongVarcharTypeName()
          The schema definition name for Types.LONGVARCHAR.
 int getMaxCharacterFieldLength()
          Returns the maximum number of characters a VARCHAR type field can hold.
 int getMaxCharactersInAutoIncrement()
           
 Integer getMaxCharactersInTableName()
          The maximum number of characters in a table name.
 int getMaxColumnNameLength()
          Returns the maximum number of characters in a column name for this database.
 int getMaxForeignKeyNameLength()
          Returns the maximum number of characters in a foreign key name for this database.
 int getMaxIndexesPerTable()
          The maximum number of indexes that can be created for a single table, or Integer.MAX_VALUE if there is no limit.
 int getMaxIndexNameLength()
          Returns the maximum number of characters in a foreign key name for this database.
 Integer getMaxKeyNameLength()
          The maximum number of characters in any key.
 int getMaxPrimaryKeyNameLength()
          Returns the maximum number of characters in a primary key name for this database.
 int getMaxTableNameLength()
          Returns the maximum number of characters in a table name for this database.
 String getNullColumnName()
          An identifer that represents a null column (such as "%").
 String getNullTableName()
          An identifer that represents a null table (such as "%").
 String getNullTypeName()
          The schema definition name for Types.NULL.
 String getNumericTypeName()
          The schema definition name for Types.NUMERIC.
 Object getObject(ResultSet rs, int column, Map map)
          Convert the specified column of the SQL ResultSet to the proper java type.
protected  SQLBuffer getOrderings(Select sel, SQLBuffer selectSQL, boolean forUpdate)
          Return the portion of the select statement after the ORDER BY clause, or null if no orderings.
 String getOtherTypeName()
          The schema definition name for Types.OTHER.
 String getPlatform()
          The database platform for this dictionary.
 int getPreferredType(int type)
          Return the preferred Types type for the given one.
protected  String getPrimaryKeyConstraintSQL(PrimaryKey pk)
          Return the declaration SQL for the given primary key.
 PrimaryKeyInfo[] getPrimaryKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn)
          Return an array of PrimaryKeyInfo for the specified schema objects.
protected  PrimaryKeyInfo[] getPrimaryKeysFromBestRowIdentifier(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn)
           
protected  PrimaryKeyInfo[] getPrimaryKeysFromGetPrimaryKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn)
           
 String getRealTypeName()
          The schema definition name for Types.REAL.
 Ref getRef(ResultSet rs, int column, Map map)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getRefTypeName()
          The schema definition name for Types.REF.
 boolean getRequiresAliasForSubselect()
          If true, then any subselect statements require that the subselect be assigned a table alias.
 boolean getRequiresAutoCommitForMetadata()
          If true, then a connection must have autocommit set to true in order to perform schema interrogation operations.
 Collection getReservedKeywords()
          Returns an upper-case list of keywords that this database considers "reserved".
 String getReservedWords()
          A comma-separated list of additional reserved words for this database.
 String getSchemaCase()
          Return how schema names (schema name, tables, database names) should be manipulated.
protected  String getSchemaNameForMetadata(String schemaName)
          Returns the schema name that will be used for obtaining information from DatabaseMetaData.
protected  SQLBuffer getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate)
          Return the portion of the select statement between the SELECT keyword and the FROM keyword.
 short getShort(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 boolean getSimulateLocking()
          If true, pessimistic locking will be allowed even if the database does not support locking.
protected  String getSizeClause(Column col)
           
 String getSmallintTypeName()
          The schema definition name for Types.SMALLINT.
 boolean getStorageLimitationsFatal()
          Whether or not an exception should be thrown if value alteration needs to take place in order to be able to be stored in the database.
 boolean getStoreCharsAsNumbers()
          If true, Java char values will be stored as numbers.
 boolean getStoreLargeNumbersAsStrings()
          If true, BigDecimals and BigIntegers will be stored as strings.
 String getString(ResultSet rs, int column)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getStructTypeName()
          The schema definition name for Types.STRUCT.
 boolean getSupportsDeferredConstraints()
           
 boolean getSupportsForeignKeys()
          Whether this database supports foreign keys or not.
 boolean getSupportsLockingWithDistinctClause()
          Whether this database supports "FOR UPDATE" queries with a "DISTINCT" clause.
 boolean getSupportsLockingWithInnerJoin()
          Whether this database supports "FOR UPDATE" queries with inner joins.
 boolean getSupportsLockingWithMultipleTables()
          Whether this database supports "FOR UPDATE" queries with multiple tables.
 boolean getSupportsLockingWithOrderClause()
          Whether this database supports "FOR UPDATE" queries with "ORDER BY" clauses.
 boolean getSupportsLockingWithOuterJoin()
          Whether this database supports "FOR UPDATE" queries with outer joins.
 boolean getSupportsMultipleNontransactionalResultSets()
          Whether this dictionary supports multiple result sets outside of a transaction.
 boolean getSupportsNullTableForGetColumns()
          If true, calls to ResultSet#getColumns can handle a null table.
 boolean getSupportsNullTableForGetImportedKeys()
          If true, calls to ResultSet#getImportedKeys can handle a null table.
 boolean getSupportsNullTableForGetIndexInfo()
          If true, calls to ResultSet#getIndexInfo can handle a null table.
 boolean getSupportsNullTableForGetPrimaryKeys()
          If true, calls to ResultSet#getPrimaryKeys can handle a null table.
 boolean getSupportsQueryTimeout()
          If true, then the JDBC driver supports Statement.setQueryTimeout(int)
 boolean getSupportsSchemaForGetColumns()
          Some drivers have problems with using the schema name in calls to DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String).
 boolean getSupportsSchemaForGetTables()
          Some drivers have problems with using the schema name in calls to DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).
 Boolean getSupportsSelectForUpdate()
          Whether this dictionary supports "SELECT ...
 Collection getSystemSchemas()
          Return the list of system schemas that will not be reflected on when constructing the in-memory representation of the schema.
 Collection getSystemTables()
          Return the list of system tables that will not be reflected on when constructing the in-memory representation of the schema.
 String getTableForUpdateClause()
          The per-table clause to append to each table alias in a SELECT.
protected  String getTableNameForMetadata(String tableName)
          Returns the table name that will be used for obtaining information from DatabaseMetaData.
 TableInfo[] getTables(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn)
          Return a result set in the form expected by DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).
 String getTableTypes()
          The table types to look for when reflecting on the schema, separated by commas.
 Time getTime(ResultSet rs, int column, Calendar cal)
          Convert the specified column of the SQL ResultSet to the proper java type.
 Timestamp getTimestamp(ResultSet rs, int column, Calendar cal)
          Convert the specified column of the SQL ResultSet to the proper java type.
 String getTimestampTypeName()
          The schema definition name for Types.TIMESTAMP.
 String getTimeTypeName()
          The schema definition name for Types.TIME.
 String getTinyintTypeName()
          The schema definition name for Types.TINYINT.
protected  String getTypeName(Column col)
          Return the preferred database type for the given column's type from Types.
 boolean getUseGetBestRowIdentifierForPrimaryKeys()
           
 boolean getUseGetBytesForBlobs()
          If true, use ResultSet.getBytes(int) for blobs.
 boolean getUseGetObjectForBlobs()
          If true, use ResultSet.getObject(int) to obtain blob data.
 boolean getUseSchemaName()
          Whether to use the schema name when constructing a full table name.
 boolean getUseSetBytesForBlobs()
          If true, use PreparedStatement.setBytes(int, byte[]) for blobs.
 boolean getUseStringsForClobs()
           
 String getValidationSQL()
          Simple SQL used to validate connections.
 String getValidColumnName(String name, Table table)
          Make any necessary changes to the given column name to make it valid for the current DB.
 String getValidForeignKeyName(String name, Table table, Table toTable)
          Make any necessary changes to the given foreign key name to make it valid for the current DB.
 String getValidIndexName(String name, Table table)
          Make any necessary changes to the given index name to make it valid for the current DB.
 String getValidPrimaryKeyName(String name, Table table)
          Make any necessary changes to the given primary key name to make it valid for the current DB.
 String getValidTableName(String name, Schema schema)
          Make any necessary changes to the given table name to make it valid for the current DB.
 String getVarbinaryTypeName()
          The schema definition name for Types.VARBINARY.
 String getVarcharTypeName()
          The schema definition name for Types.VARCHAR.
protected  SQLBuffer getWhere(Select sel, boolean forUpdate)
          Return the portion of the select statement between the WHERE keyword and the ORDER BY clause, or null if no where conditions.
 boolean isReserved(String name)
          Returns true if this database considers a name as "reserved".
 boolean isSupported()
          By default, all dictionaries are supported except for the generic DBDictionary.
 boolean isSystemIndex(String name, Table table)
          This method is used to filter system indexes from database metadata.
 boolean isSystemTable(String name, String schema, boolean targetSchema)
          This method is used to filter system tables from database metadata.
 String makeNameValid(String name, NameSet set, int maxLen)
          Shortens the given name to the given maximum length, then checks that it is not a reserved word.
 int maxKeyNameLength()
          Returns the maximum number of characters in a generic key name (e.g., an index, a primary or foreign key) for this database.
protected  ColumnInfo newColumnInfo(ResultSet rs)
          Construct a new ColumnInfo from the given ResultSet
protected  ForeignKeyInfo newForeignKeyInfo(ResultSet rs)
          Construct a new ForeignKeyInfo from the given ResultSet
protected  IndexInfo newIndexInfo(ResultSet rs)
          Construct a new IndexInfo from the given ResultSet
protected  PrimaryKeyInfo newPrimaryKeyInfo(ResultSet rs)
          Construct a new PrimaryKeyInfo from the given ResultSet
protected  TableInfo newTableInfo(ResultSet rs)
          Construct a new TableInfo from the given ResultSet
 void refSchemaComponents(Table table)
          Increment the reference count of any table components that this dictionary adds that are not used by mappings.
 ClassMapping replaceMapping(ClassMapping mapping)
          Replace the given mapping with one suited to this database, or return the original if no replacement is needed.
 FieldMapping replaceMapping(FieldMapping mapping)
          Replace the given mapping with one suited to this database, or return the original if no replacement is needed.
 MappingFactory replaceMappingFactory(MappingFactory factory)
          Replace the given factory with one suited to this database, or return the original if no replacement is needed.
 SchemaFactory replaceSchemaFactory(SchemaFactory factory)
          Replace the given factory with one suited to this database, or return the original if no replacement is needed.
protected  String replaceSize(Column col, String typeName)
          Helper method to change the size parameters of the specified type.
 byte[] serialize(Object val)
          Return the serialized bytes for the given object.
 void setArray(PreparedStatement stmnt, int idx, Array val)
          Set the given value as a parameter to the statement.
 void setAsciiStream(PreparedStatement stmnt, int idx, InputStream val, int length)
          Set the given value as a parameter to the statement.
 void setAutoIncrementClause(String autoIncrementClause)
           
 void setAutoIncrementTypeName(String autoIncrementTypeName)
           
 void setBatchLimit(int batch)
          The maximum number of statements per SQL batch.
 void setBatchParameterLimit(int batchParameterLimit)
          The maximum number of parameters that can be batched.
 void setBigDecimal(PreparedStatement stmnt, int idx, BigDecimal val)
          Set the given value as a parameter to the statement.
 void setBigInteger(PreparedStatement stmnt, int idx, BigInteger val)
          Set the given value as a parameter to the statement.
 void setBigintTypeName(String bigintTypeName)
          The schema definition name for Types.BIGINT.
 void setBinaryStream(PreparedStatement stmnt, int idx, InputStream val, int length)
          Set the given value as a parameter to the statement.
 void setBinaryTypeName(String binaryTypeName)
          The schema definition name for Types.BINARY.
 void setBitTypeName(String bitTypeName)
          The schema definition name for Types.BIT.
 void setBlob(PreparedStatement stmnt, int idx, Blob val)
          Set the given value as a parameter to the statement.
 void setBlobObject(PreparedStatement stmnt, int idx, Object val)
          Set the given value as a parameter to the statement.
 void setBlobTypeName(String blobTypeName)
          The schema definition name for Types.BLOB.
 void setBoolean(PreparedStatement stmnt, int idx, boolean val)
          Set the given value as a parameter to the statement.
 void setByte(PreparedStatement stmnt, int idx, byte val)
          Set the given value as a parameter to the statement.
 void setBytes(PreparedStatement stmnt, int idx, byte[] val)
          Set the given value as a parameter to the statement.
 void setCatalogSeparator(String sep)
           
 void setChar(PreparedStatement stmnt, int idx, char val)
          Set the given value as a parameter to the statement.
 void setCharacterStream(PreparedStatement stmnt, int idx, Reader val, int length)
          Set the given value as a parameter to the statement.
 void setCharTypeName(String charTypeName)
          The schema definition name for Types.CHAR.
 void setClob(PreparedStatement stmnt, int idx, Clob val)
          Set the given value as a parameter to the statement.
 void setClobString(PreparedStatement stmnt, int idx, String val)
          Set the given value as a parameter to the statement.
 void setClobTypeName(String clobTypeName)
          The schema definition name for Types.CLOB.
 void setConfiguration(Configuration conf)
          Invoked prior to setting bean properties.
 void setCreatePrimaryKeys(boolean createPrimaryKeys)
          If false, then do not specify that identifiers are primary keys.
 void setDate(PreparedStatement stmnt, int idx, Date val)
          Set the given value as a parameter to the statement.
 void setDate(PreparedStatement stmnt, int idx, Date val, Calendar cal)
          Set the given value as a parameter to the statement.
 void setDateTypeName(String dateTypeName)
          The schema definition name for Types.DATE.
 void setDBMetaData(DBMetaData meta)
          Set the database metadata for this dictionary.
 void setDecimalTypeName(String decimalTypeName)
          The schema definition name for Types.DECIMAL.
 void setDefaultSchemaName(String defaultSchemaName)
          The schema name to use for metadata operations if none is set.
 void setDistinctCountColumnSeparator(String sep)
          The separator to use to combine columns in a COUNT(DISTINCT columns) clause, or null if this database does not support multiple distinct entries in a COUNT.
 void setDistinctTypeName(String distinctTypeName)
          The schema definition name for Types.DISTINCT.
 void setDouble(PreparedStatement stmnt, int idx, double val)
          Set the given value as a parameter to the statement.
 void setDoubleTypeName(String doubleTypeName)
          The schema definition name for Types.DOUBLE.
 void setFloat(PreparedStatement stmnt, int idx, float val)
          Set the given value as a parameter to the statement.
 void setFloatTypeName(String floatTypeName)
          The schema definition name for Types.FLOAT.
 void setForUpdateClause(String forUpdateClause)
          The clause that is used for issuing "SELECT ...
 void setInitializationSQL(String initializationSQL)
          SQL that will be issued to the database whenever a connection is made.
 void setInt(PreparedStatement stmnt, int idx, int val)
          Set the given value as a parameter to the statement.
 void setIntegerTypeName(String integerTypeName)
          The schema definition name for Types.INTEGER.
 void setJavaObjectTypeName(String javaObjectTypeName)
          The schema definition name for Types.JAVA_OBJECT.
 void setJoinSyntax(String syntax)
          The join syntax to use as a string for automatic configuration: sql92, traditional, database
protected  void setJoinSyntaxConstant(int joinSyntax)
          The SQL join syntax to use as one of the Join syntax constants.
 void setLastGeneratedKeyQuery(String lastGeneratedKeyQuery)
          The query that will be used to query the last automatically generated key on the server.
 void setLocale(PreparedStatement stmnt, int idx, Locale val)
          Set the given value as a parameter to the statement.
 void setLong(PreparedStatement stmnt, int idx, long val)
          Set the given value as a parameter to the statement.
 void setLongVarbinaryTypeName(String longVarbinaryTypeName)
          The schema definition name for Types.LONGVARBINARY.
 void setLongVarcharTypeName(String longVarcharTypeName)
          The schema definition name for Types.LONGVARCHAR.
 void setMaxCharactersInAutoIncrement(int max)
           
 void setMaxCharactersInTableName(Integer maxCharactersInTableName)
          The maximum number of characters in a table name.
 void setMaxIndexesPerTable(int maxIndexesPerTable)
          The maximum number of indexes that can be created for a single table, or Integer.MAX_VALUE if there is no limit.
 void setMaxKeyNameLength(Integer maxKeyNameLength)
          The maximum number of characters in any key.
 void setNull(PreparedStatement stmnt, int idx, int colType)
          Set the given value as a parameters to the statement.
 void setNullColumnName(String nullColumnName)
          An identifer that represents a null column (such as "%").
 void setNullTableName(String nullTableName)
          An identifer that represents a null table (such as "%").
 void setNullTypeName(String nullTypeName)
          The schema definition name for Types.NULL.
 void setNumericTypeName(String numericTypeName)
          The schema definition name for Types.NUMERIC.
 void setObject(PreparedStatement stmnt, int idx, Object val, int colType)
          Set the given value as a parameters to the statement.
 void setOtherTypeName(String otherTypeName)
          The schema definition name for Types.OTHER.
protected  void setPlatform(String platform)
          The database platform for this dictionary.
 void setRealTypeName(String realTypeName)
          The schema definition name for Types.REAL.
 void setRef(PreparedStatement stmnt, int idx, Ref val)
          Set the given value as a parameter to the statement.
 void setRefTypeName(String refTypeName)
          The schema definition name for Types.REF.
 void setRequiresAliasForSubselect(boolean requiresAliasForSubselect)
          If true, then any subselect statements require that the subselect be assigned a table alias.
 void setRequiresAutoCommitForMetadata(boolean req)
          If true, then a connection must have autocommit set to true in order to perform schema interrogation operations.
 void setReservedWords(String reservedWords)
          A comma-separated list of additional reserved words for this database.
 void setSchemaCase(String schemaCase)
          Set how schema names (schema name, tables, database names) should be manipulated.
 void setShort(PreparedStatement stmnt, int idx, short val)
          Set the given value as a parameter to the statement.
 void setSimulateLocking(boolean simulate)
          If true, pessimistic locking will be allowed even if the database does not support locking.
 void setSmallintTypeName(String smallintTypeName)
          The schema definition name for Types.SMALLINT.
 void setStorageLimitationsFatal(boolean storageLimitationsFatal)
          Whether or not an exception should be thrown if value alteration needs to take place in order to be able to be stored in the database.
 void setStoreCharsAsNumbers(boolean charsAsNumbers)
          If true, Java char values will be stored as numbers.
 void setStoreLargeNumbersAsStrings(boolean asStrings)
          If true, BigDecimals and BigIntegers will be stored as strings.
 void setString(PreparedStatement stmnt, int idx, String val)
          Set the given value as a parameter to the statement.
 void setStructTypeName(String structTypeName)
          The schema definition name for Types.STRUCT.
 void setSupportsDeferredConstraints(boolean supportsDeferredConstraints)
           
 void setSupportsForeignKeys(boolean supportsForeignKeys)
          Whether this database supports foreign keys or not.
 void setSupportsLockingWithDistinctClause(boolean support)
          Whether this database supports "FOR UPDATE" queries with a "DISTINCT" clause.
 void setSupportsLockingWithInnerJoin(boolean sel)
          Whether this database supports "FOR UPDATE" queries with inner joins.
 void setSupportsLockingWithMultipleTables(boolean support)
          Whether this database supports "FOR UPDATE" queries with multiple tables.
 void setSupportsLockingWithOrderClause(boolean support)
          Whether this database supports "FOR UPDATE" queries with "ORDER BY" clauses.
 void setSupportsLockingWithOuterJoin(boolean sel)
          Whether this database supports "FOR UPDATE" queries with outer joins.
 void setSupportsMultipleNontransactionalResultSets(boolean sup)
          Whether this dictionary supports multiple result sets outside of a transaction.
 void setSupportsNullTableForGetColumns(boolean sup)
          If true, calls to ResultSet#getColumns can handle a null table.
 void setSupportsNullTableForGetImportedKeys(boolean sup)
          If true, calls to ResultSet#getImportedKeys can handle a null table.
 void setSupportsNullTableForGetIndexInfo(boolean sup)
          If true, calls to ResultSet#getIndexInfo can handle a null table.
 void setSupportsNullTableForGetPrimaryKeys(boolean sup)
          If true, calls to ResultSet#getPrimaryKeys can handle a null table.
 void setSupportsQueryTimeout(boolean supportsQueryTimeout)
          If true, then the JDBC driver supports Statement.setQueryTimeout(int)
 void setSupportsSchemaForGetColumns(boolean sup)
          Some drivers have problems with using the schema name in calls to DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String).
 void setSupportsSchemaForGetTables(boolean sup)
          Some drivers have problems with using the schema name in calls to DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).
 void setSupportsSelectForUpdate(Boolean supportsSelectForUpdate)
          Whether this dictionary supports "SELECT ...
 void setSystemSchemas(String schemaNames)
          Set a comma-separated string of table names that are considered system schemas and should not be reflected on.
 void setSystemTables(String tableNames)
          Set a comma-separated string of table names that are considered system tables and should not be reflected on.
 void setTableForUpdateClause(String tableForUpdateClause)
          The per-table clause to append to each table alias in a SELECT.
 void setTableTypes(String types)
          The table types to look for when reflecting on the schema, separated by commas.
 void setTime(PreparedStatement stmnt, int idx, Time val, Calendar cal)
          Set the given value as a parameter to the statement.
 void setTimestamp(PreparedStatement stmnt, int idx, Timestamp val, Calendar cal)
          Set the given value as a parameter to the statement.
 void setTimestampTypeName(String timestampTypeName)
          The schema definition name for Types.TIMESTAMP.
 void setTimeTypeName(String timeTypeName)
          The schema definition name for Types.TIME.
 void setTinyintTypeName(String tinyintTypeName)
          The schema definition name for Types.TINYINT.
 void setUseGetBestRowIdentifierForPrimaryKeys(boolean useBestRow)
           
 void setUseGetBytesForBlobs(boolean useGetBytesForBlobs)
          If true, use ResultSet.getBytes(int) for blobs.
 void setUseGetObjectForBlobs(boolean useGetObjectForBlobs)
          If true, use ResultSet.getObject(int) to obtain blob data.
 void setUseSchemaName(boolean useSchemaName)
          Whether to use the schema name when constructing a full table name.
 void setUseSetBytesForBlobs(boolean useSetBytesForBlobs)
          If true, use PreparedStatement.setBytes(int, byte[]) for blobs.
 void setUseStringsForClobs(boolean useStringsForClobs)
          If true, then use ResultSet.getString(int) and PreparedStatement.setString(int, java.lang.String) for clob handling.
 void setValidationSQL(String sql)
          Simple SQL used to validate connections.
 void setVarbinaryTypeName(String varbinaryTypeName)
          The schema definition name for Types.VARBINARY.
 void setVarcharTypeName(String varcharTypeName)
          The schema definition name for Types.VARCHAR.
 void startConfiguration()
          Invoked before bean property configuration is begun on this object.
protected  void storageWarning(Object orig, Object converted)
          Warn that a particular value could not be stored precisely.
 boolean supportsAutoIncrement()
          Return true if this dictionary supports auto increment columns.
 boolean supportsForeignKey(ForeignKey fk)
          Return true if the database supports the given foreign key.
 boolean supportsRandomAccessResultSet(Select sel, boolean forUpdate)
          Return false if the given select requires a forward-only result set.
 boolean supportsSelectForUpdate()
          Whether locking on queries is supported; returns the metadata's reported value by default.
protected  boolean supportsSizeInColumnDefinition(Column col, String name)
          Returns true if a schema definition statement supports appending the size after the column type.
 boolean supportsTotalCountsForBatch()
          Returns true if Statement.executeBatch() will return an array with a single integer that represents the total number rows updated by the batch execution.
 boolean supportsUpdateCountsForBatch()
          Return true if the database returns meaningful update counts on batched statements.
 SQLBuffer toNativeJoin(Join join)
          Use the given join instance to create SQL joining its tables in the database's native syntax.
 SQLBuffer toSelect(Select sel, boolean forUpdate)
          Create a SELECT statement in the proper join syntax for the given instance.
 SQLBuffer toSelect(SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer order, boolean distinct, boolean forUpdate)
          Combine the given components into a SELECT statement.
 SQLBuffer toSelectCount(Select sel)
          Create a SELECT COUNT statement in the proper join syntax for the given instance.
 SQLBuffer toSQL92Join(Join join, boolean forUpdate, boolean first)
          Use the given join instance to create SQL joining its tables in the SQL92 style.
 SQLBuffer toTraditionalJoin(Join join)
          Use the given join instance to create SQL joining its tables in the traditional style.
protected  void warnSupportedDictionary()
          If this dictionary is not supported, issue a warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEMA_CASE_UPPER

public static final String SCHEMA_CASE_UPPER
Symbolic constant for setSchemaCase that indicates that schema names should always be converted to upper-case.

SCHEMA_CASE_LOWER

public static final String SCHEMA_CASE_LOWER
Symbolic constant for setSchemaCase that indicates that schema names should always be converted to lower-case.

SCHEMA_CASE_PRESERVE

public static final String SCHEMA_CASE_PRESERVE
Symbolic constant for setSchemaCase that indicates that no changes should be made to the specified schema name.

SCHEMA_CASE_DEFAULT

public static final String SCHEMA_CASE_DEFAULT
Symbolic constant for setSchemaCase that indicates that no changes should be made to the specified schema name.

NANO

protected static final int NANO

MICRO

protected static final int MICRO

MILLI

protected static final int MILLI

CENTI

protected static final int CENTI

DECI

protected static final int DECI

SEC

protected static final int SEC
Constructor Detail

DBDictionary

public DBDictionary()
Method Detail

getConfiguration

public JDBCConfiguration getConfiguration()
Get the configuration for this dictionary.

getDBMetaData

public DBMetaData getDBMetaData()
Return the DBMetaData for this dictionary. The metadata is not set until the dictionary has been configured.

setDBMetaData

public void setDBMetaData(DBMetaData meta)
                   throws SQLException
Set the database metadata for this dictionary. This method will be called by the system.

warnSupportedDictionary

protected void warnSupportedDictionary()
If this dictionary is not supported, issue a warning.

isSupported

public boolean isSupported()
By default, all dictionaries are supported except for the generic DBDictionary.

setPlatform

protected void setPlatform(String platform)
The database platform for this dictionary.

getPlatform

public String getPlatform()
The database platform for this dictionary.

getJoinSyntaxConstant

public int getJoinSyntaxConstant()
The SQL join syntax to use as one of the Join syntax constants.

setJoinSyntaxConstant

protected void setJoinSyntaxConstant(int joinSyntax)
The SQL join syntax to use as one of the Join syntax constants.

getJoinSyntax

public String getJoinSyntax()
The join syntax to use as a string for automatic configuration: sql92, traditional, database

setJoinSyntax

public void setJoinSyntax(String syntax)
The join syntax to use as a string for automatic configuration: sql92, traditional, database

getStoreCharsAsNumbers

public boolean getStoreCharsAsNumbers()
If true, Java char values will be stored as numbers. Defaults to false.

setStoreCharsAsNumbers

public void setStoreCharsAsNumbers(boolean charsAsNumbers)
If true, Java char values will be stored as numbers. Defaults to false.

getStoreLargeNumbersAsStrings

public boolean getStoreLargeNumbersAsStrings()
If true, BigDecimals and BigIntegers will be stored as strings. Defaults to false.

setStoreLargeNumbersAsStrings

public void setStoreLargeNumbersAsStrings(boolean asStrings)
If true, BigDecimals and BigIntegers will be stored as strings. Defaults to false.

getTableTypes

public String getTableTypes()
The table types to look for when reflecting on the schema, separated by commas. For example, "TABLE, VIEW, ALIAS". Defaults to "TABLE".

setTableTypes

public void setTableTypes(String types)
The table types to look for when reflecting on the schema, separated by commas. For example, "TABLE, VIEW, ALIAS". Defaults to "TABLE".

setUseSetBytesForBlobs

public void setUseSetBytesForBlobs(boolean useSetBytesForBlobs)
If true, use PreparedStatement.setBytes(int, byte[]) for blobs.

getUseSetBytesForBlobs

public boolean getUseSetBytesForBlobs()
If true, use PreparedStatement.setBytes(int, byte[]) for blobs.

setUseGetBytesForBlobs

public void setUseGetBytesForBlobs(boolean useGetBytesForBlobs)
If true, use ResultSet.getBytes(int) for blobs.

getUseGetBytesForBlobs

public boolean getUseGetBytesForBlobs()
If true, use ResultSet.getBytes(int) for blobs.

setUseGetObjectForBlobs

public void setUseGetObjectForBlobs(boolean useGetObjectForBlobs)
If true, use ResultSet.getObject(int) to obtain blob data.

getUseGetObjectForBlobs

public boolean getUseGetObjectForBlobs()
If true, use ResultSet.getObject(int) to obtain blob data.

setCreatePrimaryKeys

public void setCreatePrimaryKeys(boolean createPrimaryKeys)
If false, then do not specify that identifiers are primary keys.

getCreatePrimaryKeys

public boolean getCreatePrimaryKeys()
If false, then do not specify that identifiers are primary keys.

setUseStringsForClobs

public void setUseStringsForClobs(boolean useStringsForClobs)
If true, then use ResultSet.getString(int) and PreparedStatement.setString(int, java.lang.String) for clob handling. Otherwise, use ResultSet.getClob(int) and PreparedStatement.setCharacterStream(int, java.io.Reader, int).

getUseStringsForClobs

public boolean getUseStringsForClobs()

setSupportsDeferredConstraints

public void setSupportsDeferredConstraints(boolean supportsDeferredConstraints)

getSupportsDeferredConstraints

public boolean getSupportsDeferredConstraints()

setSupportsForeignKeys

public void setSupportsForeignKeys(boolean supportsForeignKeys)
Whether this database supports foreign keys or not.

getSupportsForeignKeys

public boolean getSupportsForeignKeys()
Whether this database supports foreign keys or not.

setStorageLimitationsFatal

public void setStorageLimitationsFatal(boolean storageLimitationsFatal)
Whether or not an exception should be thrown if value alteration needs to take place in order to be able to be stored in the database.

getStorageLimitationsFatal

public boolean getStorageLimitationsFatal()
Whether or not an exception should be thrown if value alteration needs to take place in order to be able to be stored in the database.

setSchemaCase

public void setSchemaCase(String schemaCase)
Set how schema names (schema name, tables, database names) should be manipulated.
Parameters:
schemaCase - one of SCHEMA_CASE_PRESERVE, SCHEMA_CASE_LOWER, SCHEMA_CASE_UPPER, or SCHEMA_CASE_DEFAULT

getSchemaCase

public String getSchemaCase()
Return how schema names (schema name, tables, database names) should be manipulated.
Returns:
one of SCHEMA_CASE_PRESERVE, SCHEMA_CASE_LOWER, SCHEMA_CASE_UPPER, or SCHEMA_CASE_DEFAULT

convertSchemaCase

protected String convertSchemaCase(String objectName)
Convert the specified schema name to a name that the database will be able to understand.
See Also:
getSchemaCase()

getSimulateLocking

public boolean getSimulateLocking()
If true, pessimistic locking will be allowed even if the database does not support locking. Defaults to false.

setSimulateLocking

public void setSimulateLocking(boolean simulate)
If true, pessimistic locking will be allowed even if the database does not support locking. Defaults to false.

getBatchLimit

public int getBatchLimit()
The maximum number of statements per SQL batch.

setBatchLimit

public void setBatchLimit(int batch)
The maximum number of statements per SQL batch.

setBatchParameterLimit

public void setBatchParameterLimit(int batchParameterLimit)
The maximum number of parameters that can be batched. The maximum number of rows to be batched will be (Rows * (Parameters per Row)).

getBatchParameterLimit

public int getBatchParameterLimit()
The maximum number of parameters that can be batched. The maximum number of rows to be batched will be (Rows * (Parameters per Row)).

getSystemTables

public Collection getSystemTables()
Return the list of system tables that will not be reflected on when constructing the in-memory representation of the schema.

setSystemTables

public void setSystemTables(String tableNames)
Set a comma-separated string of table names that are considered system tables and should not be reflected on. Used by the auto-configuration mechanism to set a list of tables from properties.

addSystemTable

public void addSystemTable(String tableName)
Add the name of a table that should not be reflected on.

getSystemSchemas

public Collection getSystemSchemas()
Return the list of system schemas that will not be reflected on when constructing the in-memory representation of the schema.

setSystemSchemas

public void setSystemSchemas(String schemaNames)
Set a comma-separated string of table names that are considered system schemas and should not be reflected on. Used by the auto-configuration mechanism to set a list of schemas from properties.

addSystemSchema

public void addSystemSchema(String schemaName)
Add the name of a schema that should not be reflected on.

getValidationSQL

public String getValidationSQL()
Simple SQL used to validate connections.

setValidationSQL

public void setValidationSQL(String sql)
Simple SQL used to validate connections.

supportsUpdateCountsForBatch

public boolean supportsUpdateCountsForBatch()
Return true if the database returns meaningful update counts on batched statements. Returns true by default.

supportsTotalCountsForBatch

public boolean supportsTotalCountsForBatch()
Returns true if Statement.executeBatch() will return an array with a single integer that represents the total number rows updated by the batch execution.

getCatalogSeparator

public String getCatalogSeparator()
Returns the separator String between the schema name and the table name. This will usually be ".". The default can be overridden with setCatalogSeparator(java.lang.String).

setCatalogSeparator

public void setCatalogSeparator(String sep)

getDistinctCountColumnSeparator

public String getDistinctCountColumnSeparator()
The separator to use to combine columns in a COUNT(DISTINCT columns) clause, or null if this database does not support multiple distinct entries in a COUNT. Null by default.

setDistinctCountColumnSeparator

public void setDistinctCountColumnSeparator(String sep)
The separator to use to combine columns in a COUNT(DISTINCT columns) clause, or null if this database does not support multiple distinct entries in a COUNT. Null by default.

getFullName

public String getFullName(Table table)
Returns the full name of the table, including the schema (delimited by the result of getCatalogSeparator()).

getFullName

public String getFullName(Table table,
                          boolean logical)
Returns the full name of the table, including the schema. If the logical flag is set, uses the logical '.' catalog separator, else uses the result of getCatalogSeparator()).

getFullName

public String getFullName(Index index)
Returns the full name of the index, including the schema (delimited by the result of getCatalogSeparator()).

supportsForeignKey

public boolean supportsForeignKey(ForeignKey fk)
Return true if the database supports the given foreign key. By default, checks that the action is not ForeignKey.ACTION_NONE and checks the key's deferrability against the return value of #supportsDeferredConstraints.

supportsSelectForUpdate

public boolean supportsSelectForUpdate()
Whether locking on queries is supported; returns the metadata's reported value by default.

getArray

public Array getArray(ResultSet rs,
                      int column)
               throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getAsciiStream

public InputStream getAsciiStream(ResultSet rs,
                                  int column)
                           throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getBigDecimal

public BigDecimal getBigDecimal(ResultSet rs,
                                int column)
                         throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getBigInteger

public BigInteger getBigInteger(ResultSet rs,
                                int column)
                         throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getBinaryStream

public InputStream getBinaryStream(ResultSet rs,
                                   int column)
                            throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getBlob

public Blob getBlob(ResultSet rs,
                    int column)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getBlobStream

public InputStream getBlobStream(ResultSet rs,
                                 int column)
                          throws SQLException
Returns an InputStream for the blob data specified in the ResultSet.

getBlobObject

public Object getBlobObject(ResultSet rs,
                            int column)
                     throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getBoolean

public boolean getBoolean(ResultSet rs,
                          int column)
                   throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getByte

public byte getByte(ResultSet rs,
                    int column)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getBytes

public byte[] getBytes(ResultSet rs,
                       int column)
                throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getChar

public char getChar(ResultSet rs,
                    int column)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getCharacterStream

public Reader getCharacterStream(ResultSet rs,
                                 int column)
                          throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getClob

public Clob getClob(ResultSet rs,
                    int column)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getClobString

public String getClobString(ResultSet rs,
                            int column)
                     throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getDate

public Date getDate(ResultSet rs,
                    int column)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type. Converts the date from a Timestamp by default.

getDate

public Date getDate(ResultSet rs,
                    int column,
                    Calendar cal)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getDouble

public double getDouble(ResultSet rs,
                        int column)
                 throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getFloat

public float getFloat(ResultSet rs,
                      int column)
               throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getInt

public int getInt(ResultSet rs,
                  int column)
           throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getLocale

public Locale getLocale(ResultSet rs,
                        int column)
                 throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getLong

public long getLong(ResultSet rs,
                    int column)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getObject

public Object getObject(ResultSet rs,
                        int column,
                        Map map)
                 throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getRef

public Ref getRef(ResultSet rs,
                  int column,
                  Map map)
           throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getShort

public short getShort(ResultSet rs,
                      int column)
               throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getString

public String getString(ResultSet rs,
                        int column)
                 throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getTime

public Time getTime(ResultSet rs,
                    int column,
                    Calendar cal)
             throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

getTimestamp

public Timestamp getTimestamp(ResultSet rs,
                              int column,
                              Calendar cal)
                       throws SQLException
Convert the specified column of the SQL ResultSet to the proper java type.

storageWarning

protected void storageWarning(Object orig,
                              Object converted)
Warn that a particular value could not be stored precisely. After the first warning for a particular type, messages will be turned into trace messages.

setArray

public void setArray(PreparedStatement stmnt,
                     int idx,
                     Array val)
              throws SQLException
Set the given value as a parameter to the statement.

setAsciiStream

public void setAsciiStream(PreparedStatement stmnt,
                           int idx,
                           InputStream val,
                           int length)
                    throws SQLException
Set the given value as a parameter to the statement.

setBigDecimal

public void setBigDecimal(PreparedStatement stmnt,
                          int idx,
                          BigDecimal val)
                   throws SQLException
Set the given value as a parameter to the statement.

setBigInteger

public void setBigInteger(PreparedStatement stmnt,
                          int idx,
                          BigInteger val)
                   throws SQLException
Set the given value as a parameter to the statement.

setBinaryStream

public void setBinaryStream(PreparedStatement stmnt,
                            int idx,
                            InputStream val,
                            int length)
                     throws SQLException
Set the given value as a parameter to the statement.

setBlob

public void setBlob(PreparedStatement stmnt,
                    int idx,
                    Blob val)
             throws SQLException
Set the given value as a parameter to the statement.

setBlobObject

public void setBlobObject(PreparedStatement stmnt,
                          int idx,
                          Object val)
                   throws SQLException
Set the given value as a parameter to the statement. Uses the serialize(java.lang.Object) method to serialize the value.

serialize

public byte[] serialize(Object val)
                 throws SQLException
Return the serialized bytes for the given object.

setBoolean

public void setBoolean(PreparedStatement stmnt,
                       int idx,
                       boolean val)
                throws SQLException
Set the given value as a parameter to the statement.

setByte

public void setByte(PreparedStatement stmnt,
                    int idx,
                    byte val)
             throws SQLException
Set the given value as a parameter to the statement.

setBytes

public void setBytes(PreparedStatement stmnt,
                     int idx,
                     byte[] val)
              throws SQLException
Set the given value as a parameter to the statement.

setChar

public void setChar(PreparedStatement stmnt,
                    int idx,
                    char val)
             throws SQLException
Set the given value as a parameter to the statement.

setCharacterStream

public void setCharacterStream(PreparedStatement stmnt,
                               int idx,
                               Reader val,
                               int length)
                        throws SQLException
Set the given value as a parameter to the statement.

setClob

public void setClob(PreparedStatement stmnt,
                    int idx,
                    Clob val)
             throws SQLException
Set the given value as a parameter to the statement.

setClobString

public void setClobString(PreparedStatement stmnt,
                          int idx,
                          String val)
                   throws SQLException
Set the given value as a parameter to the statement.

setDate

public void setDate(PreparedStatement stmnt,
                    int idx,
                    Date val)
             throws SQLException
Set the given value as a parameter to the statement. Translates the date to a Timestamp by default.

setDate

public void setDate(PreparedStatement stmnt,
                    int idx,
                    Date val,
                    Calendar cal)
             throws SQLException
Set the given value as a parameter to the statement.

setDouble

public void setDouble(PreparedStatement stmnt,
                      int idx,
                      double val)
               throws SQLException
Set the given value as a parameter to the statement.

setFloat

public void setFloat(PreparedStatement stmnt,
                     int idx,
                     float val)
              throws SQLException
Set the given value as a parameter to the statement.

setInt

public void setInt(PreparedStatement stmnt,
                   int idx,
                   int val)
            throws SQLException
Set the given value as a parameter to the statement.

setLong

public void setLong(PreparedStatement stmnt,
                    int idx,
                    long val)
             throws SQLException
Set the given value as a parameter to the statement.

setLocale

public void setLocale(PreparedStatement stmnt,
                      int idx,
                      Locale val)
               throws SQLException
Set the given value as a parameter to the statement.

setNull

public void setNull(PreparedStatement stmnt,
                    int idx,
                    int colType)
             throws SQLException
Set the given value as a parameters to the statement. The column type will come from Types.

setObject

public void setObject(PreparedStatement stmnt,
                      int idx,
                      Object val,
                      int colType)
               throws SQLException
Set the given value as a parameters to the statement. The column type will come from Types.

setRef

public void setRef(PreparedStatement stmnt,
                   int idx,
                   Ref val)
            throws SQLException
Set the given value as a parameter to the statement.

setShort

public void setShort(PreparedStatement stmnt,
                     int idx,
                     short val)
              throws SQLException
Set the given value as a parameter to the statement.

setString

public void setString(PreparedStatement stmnt,
                      int idx,
                      String val)
               throws SQLException
Set the given value as a parameter to the statement.

setTime

public void setTime(PreparedStatement stmnt,
                    int idx,
                    Time val,
                    Calendar cal)
             throws SQLException
Set the given value as a parameter to the statement.

setTimestamp

public void setTimestamp(PreparedStatement stmnt,
                         int idx,
                         Timestamp val,
                         Calendar cal)
                  throws SQLException
Set the given value as a parameter to the statement.

getDatePrecision

protected int getDatePrecision()
Set to the precision of timestamps in the data store. Set to one of: NANO, MICRO, MILLI, CENTI, DECI, SEC. Returns MILLI by default.

getJDBCType

public int getJDBCType(int metaTypeCode,
                       boolean lob)
Return the preferred Types constant for the given FieldMapping constant.

canBatch

public boolean canBatch(Column col)
Returns type if the specified column can be included in batch statements.

getPreferredType

public int getPreferredType(int type)
Return the preferred Types type for the given one. Returns the given type by default.

configureReflectedColumn

public void configureReflectedColumn(Column col,
                                     String typeName)
Configure the specified column with the typeName from the DatabaseMetaData.
Parameters:
col - the Column to configure
typeName - the TYPE_NAME as reported by the metadata

getTypeName

protected String getTypeName(Column col)
Return the preferred database type for the given column's type from Types. Defaults to using the DBMetaData.

appendSize

protected String appendSize(Column col,
                            String typeName)
Helper method to append the size and decimal digits to the given type name.

replaceSize

protected String replaceSize(Column col,
                             String typeName)
Helper method to change the size parameters of the specified type. A type name such as "NUMERIC{0}" will be replaced with "NUMERIC(10,0)".

getSizeClause

protected String getSizeClause(Column col)

supportsSizeInColumnDefinition

protected boolean supportsSizeInColumnDefinition(Column col,
                                                 String name)
Returns true if a schema definition statement supports appending the size after the column type. For example some databases allow FLOAT(20), but other databases disallow INT8(16).

supportsRandomAccessResultSet

public boolean supportsRandomAccessResultSet(Select sel,
                                             boolean forUpdate)
Return false if the given select requires a forward-only result set.

toSelectCount

public SQLBuffer toSelectCount(Select sel)
Create a SELECT COUNT statement in the proper join syntax for the given instance.

toSelect

public SQLBuffer toSelect(Select sel,
                          boolean forUpdate)
Create a SELECT statement in the proper join syntax for the given instance.

canLock

public boolean canLock(Select select)
Returns true if a "FOR UPDATE" clause can be used for the specified Select object.

toSelect

public SQLBuffer toSelect(SQLBuffer selects,
                          SQLBuffer from,
                          SQLBuffer where,
                          SQLBuffer order,
                          boolean distinct,
                          boolean forUpdate)
Combine the given components into a SELECT statement.

assertSelectForUpdate

public boolean assertSelectForUpdate()
Returns true if this dictionary supports "SELECT ... FOR UPDATE" statements for exclusive write lock acquisition. If it is not supported, then this method will throw a JDOUserException unless getSimulateLocking() is true.

getSelects

protected SQLBuffer getSelects(Select sel,
                               boolean distinctIdentifiers,
                               boolean forUpdate)
Return the portion of the select statement between the SELECT keyword and the FROM keyword.

getOrderings

protected SQLBuffer getOrderings(Select sel,
                                 SQLBuffer selectSQL,
                                 boolean forUpdate)
Return the portion of the select statement after the ORDER BY clause, or null if no orderings.

getFrom

protected SQLBuffer getFrom(Select sel,
                            boolean forUpdate)
Return the portion of the select statement between the FROM keyword and the WHERE keyword.

getWhere

protected SQLBuffer getWhere(Select sel,
                             boolean forUpdate)
Return the portion of the select statement between the WHERE keyword and the ORDER BY clause, or null if no where conditions.

toTraditionalJoin

public SQLBuffer toTraditionalJoin(Join join)
Use the given join instance to create SQL joining its tables in the traditional style.

toSQL92Join

public SQLBuffer toSQL92Join(Join join,
                             boolean forUpdate,
                             boolean first)
Use the given join instance to create SQL joining its tables in the SQL92 style.

toNativeJoin

public SQLBuffer toNativeJoin(Join join)
Use the given join instance to create SQL joining its tables in the database's native syntax. Throws an exception by default.

getValidTableName

public String getValidTableName(String name,
                                Schema schema)
Make any necessary changes to the given table name to make it valid for the current DB.
See Also:
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)

getMaxTableNameLength

public int getMaxTableNameLength()
Returns the maximum number of characters in a table name for this database.

getValidColumnName

public String getValidColumnName(String name,
                                 Table table)
Make any necessary changes to the given column name to make it valid for the current DB.
See Also:
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)

getMaxColumnNameLength

public int getMaxColumnNameLength()
Returns the maximum number of characters in a column name for this database.

getValidPrimaryKeyName

public String getValidPrimaryKeyName(String name,
                                     Table table)
Make any necessary changes to the given primary key name to make it valid for the current DB.
See Also:
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)

getMaxPrimaryKeyNameLength

public int getMaxPrimaryKeyNameLength()
Returns the maximum number of characters in a primary key name for this database.

maxKeyNameLength

public int maxKeyNameLength()
Returns the maximum number of characters in a generic key name (e.g., an index, a primary or foreign key) for this database.

getMaxCharacterFieldLength

public int getMaxCharacterFieldLength()
Returns the maximum number of characters a VARCHAR type field can hold.

getValidForeignKeyName

public String getValidForeignKeyName(String name,
                                     Table table,
                                     Table toTable)
Make any necessary changes to the given foreign key name to make it valid for the current DB.
See Also:
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)

getMaxForeignKeyNameLength

public int getMaxForeignKeyNameLength()
Returns the maximum number of characters in a foreign key name for this database.

getValidIndexName

public String getValidIndexName(String name,
                                Table table)
Make any necessary changes to the given index name to make it valid for the current DB.
See Also:
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)

getMaxIndexNameLength

public int getMaxIndexNameLength()
Returns the maximum number of characters in a foreign key name for this database.

makeNameValid

public String makeNameValid(String name,
                            NameSet set,
                            int maxLen)
Shortens the given name to the given maximum length, then checks that it is not a reserved word. If it is reserved, appends a "0". If the name conflicts with an existing schema component, the last character is replace with '0', then '1', etc. Note that the given max len may be 0 if the database metadata is incomplete.

isReserved

public boolean isReserved(String name)
Returns true if this database considers a name as "reserved".

getReservedKeywords

public Collection getReservedKeywords()
Returns an upper-case list of keywords that this database considers "reserved". Note that this is in addition to the default SQL92 reserved keywords.

setReservedWords

public void setReservedWords(String reservedWords)
A comma-separated list of additional reserved words for this database.

getReservedWords

public String getReservedWords()
A comma-separated list of additional reserved words for this database.

getCreateTableSQL

public String[] getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. Indexes and constraints will be created separately.

getDropTableSQL

public String[] getDropTableSQL(Table table)
Return a series of SQL statements to drop the given table. Indexes will be dropped separately. Returns DROP TABLE <table name> by default.

getCreateIndexSQL

public String[] getCreateIndexSQL(Index index)
Return a series of SQL statements to create the given index. Returns CREATE [UNIQUE] INDEX <index name> ON <table name> (<col list>) by default.

getDropIndexSQL

public String[] getDropIndexSQL(Index index)
Return a series of SQL statements to drop the given index. Returns DROP INDEX <index name> by default.

getAddColumnSQL

public String[] getAddColumnSQL(Column column)
Return a series of SQL statements to add the given column to its table. Return an empty array if operation not supported. The DBMetaData is checked for support automatically. Returns ALTER TABLE <table name> ADD (<col dec>) by default.

getDropColumnSQL

public String[] getDropColumnSQL(Column column)
Return a series of SQL statements to drop the given column from its table. Return an empty array if operation not supported. The DBMetaData is checked for support automatically. Returns ALTER TABLE <table name> DROP COLUMN <col name> by default.

getAddPrimaryKeySQL

public String[] getAddPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to add the given primary key to its table. Return an empty array if operation not supported. Returns ALTER TABLE <table name> ADD <pk cons sql > by default.

getDropPrimaryKeySQL

public String[] getDropPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to drop the given primary key from its table. Return an empty array if operation not supported. Returns ALTER TABLE <table name> DROP CONSTRAINT <pk name> by default.

getAddForeignKeySQL

public String[] getAddForeignKeySQL(ForeignKey fk)
Return a series of SQL statements to add the given foreign key to its table. Return an empty array if operation not supported. Returns ALTER TABLE <table name> ADD <fk cons sql > by default.

getDropForeignKeySQL

public String[] getDropForeignKeySQL(ForeignKey fk)
Return a series of SQL statements to drop the given foreign key from its table. Return an empty array if operation not supported. Returns ALTER TABLE <table name> DROP CONSTRAINT <fk name> by default.

refSchemaComponents

public void refSchemaComponents(Table table)
Increment the reference count of any table components that this dictionary adds that are not used by mappings. Does nothing by default.

getDeclareColumnSQL

protected String getDeclareColumnSQL(Column col,
                                     boolean alter)
Return the declaration SQL for the given column. This method is used for each column from within getCreateTableSQL(kodo.jdbc.schema.Table) and getAddColumnSQL(kodo.jdbc.schema.Column).

getPrimaryKeyConstraintSQL

protected String getPrimaryKeyConstraintSQL(PrimaryKey pk)
Return the declaration SQL for the given primary key. This method is used from within getCreateTableSQL(kodo.jdbc.schema.Table) and getAddPrimaryKeySQL(kodo.jdbc.schema.PrimaryKey). Returns CONSTRAINT <pk name> PRIMARY KEY (<col list>) by default.

getConstraintNameBeforeDeclaration

protected boolean getConstraintNameBeforeDeclaration()
Return whether the name of the constraint should come before or after the constraint declaration.

getForeignKeyConstraintSQL

protected String getForeignKeyConstraintSQL(ForeignKey fk)
Return the declaration SQL for the given foreign key, or null if it is not supported. This method is used from within getCreateTableSQL(kodo.jdbc.schema.Table) and getAddForeignKeySQL(kodo.jdbc.schema.ForeignKey). Returns CONSTRAINT <cons name> FOREIGN KEY (<col list>) REFERENCES <foreign table> (<col list>) [ON DELETE <action>] by default.

getForeignKeyActionName

protected String getForeignKeyActionName(int action)
Return the action SQL for the given foreign key. Return null if no action SQL should be specified (if the database default should be used). By default, returns CASCADE for ForeignKey.ACTION_CASCADE, SET NULL for ForeignKey.ACTION_NULL, SET DEFAULT for ForeignKey.ACTION_DEFAULT, and null for ForeignKey.ACTION_EXCEPTION. Any other action causes an IllegalArgumentException.

isSystemTable

public boolean isSystemTable(String name,
                             String schema,
                             boolean targetSchema)
This method is used to filter system tables from database metadata. Return true if the given table name represents a system table that should not appear in the schema definition. By default, returns true only if the given table is in the internal list of system tables, or if the given schema is in the list of system schemas and is not the target schema.
Parameters:
name - the table name
schema - the table schema; may be null
targetSchema - if true, then the given schema was listed by the user as one of his JDO schemas

isSystemIndex

public boolean isSystemIndex(String name,
                             Table table)
This method is used to filter system indexes from database metadata. Return true if the given index name represents a system index that should not appear in the schema definition. Returns false by default.
Parameters:
name - the index name
table - the index table

getTables

public TableInfo[] getTables(DatabaseMetaData meta,
                             String catalog,
                             String schemaName,
                             String tableName,
                             Connection conn)
                      throws SQLException
Return a result set in the form expected by DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]).

newTableInfo

protected TableInfo newTableInfo(ResultSet rs)
                          throws SQLException
Construct a new TableInfo from the given ResultSet

getColumns

public ColumnInfo[] getColumns(DatabaseMetaData meta,
                               String catalog,
                               String schemaName,
                               String tableName,
                               String columnName,
                               Connection conn)
                        throws SQLException
Return a result set in the form expected by DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String).

newColumnInfo

protected ColumnInfo newColumnInfo(ResultSet rs)
                            throws SQLException
Construct a new ColumnInfo from the given ResultSet

getPrimaryKeys

public PrimaryKeyInfo[] getPrimaryKeys(DatabaseMetaData meta,
                                       String catalog,
                                       String schemaName,
                                       String tableName,
                                       Connection conn)
                                throws SQLException
Return an array of PrimaryKeyInfo for the specified schema objects.

getPrimaryKeysFromGetPrimaryKeys

protected PrimaryKeyInfo[] getPrimaryKeysFromGetPrimaryKeys(DatabaseMetaData meta,
                                                            String catalog,
                                                            String schemaName,
                                                            String tableName,
                                                            Connection conn)
                                                     throws SQLException

getPrimaryKeysFromBestRowIdentifier

protected PrimaryKeyInfo[] getPrimaryKeysFromBestRowIdentifier(DatabaseMetaData meta,
                                                               String catalog,
                                                               String schemaName,
                                                               String tableName,
                                                               Connection conn)
                                                        throws SQLException

newPrimaryKeyInfo

protected PrimaryKeyInfo newPrimaryKeyInfo(ResultSet rs)
                                    throws SQLException
Construct a new PrimaryKeyInfo from the given ResultSet

getIndexInfo

public IndexInfo[] getIndexInfo(DatabaseMetaData meta,
                                String catalog,
                                String schemaName,
                                String tableName,
                                boolean unique,
                                boolean approx,
                                Connection conn)
                         throws SQLException
Return a result set in the form expected by DatabaseMetaData.getIndexInfo(java.lang.String, java.lang.String, java.lang.String, boolean, boolean), though only the TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, INDEX_NAME, COLUMN_NAME columns are required.

newIndexInfo

protected IndexInfo newIndexInfo(ResultSet rs)
                          throws SQLException
Construct a new IndexInfo from the given ResultSet

getImportedKeys

public ForeignKeyInfo[] getImportedKeys(DatabaseMetaData meta,
                                        String catalog,
                                        String schemaName,
                                        String tableName,
                                        Connection conn)
                                 throws SQLException
Return a result set in the form expected by DatabaseMetaData.getImportedKeys(java.lang.String, java.lang.String, java.lang.String), though only the PKTABLE_SCHEM, PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_SCHEM, FKTABLE_NAME, FKCOLUMN_NAME, KEY_SEQ, DELETE_RULE, FK_NAME, DEFERRABILITY columns are required.

newForeignKeyInfo

protected ForeignKeyInfo newForeignKeyInfo(ResultSet rs)
                                    throws SQLException
Construct a new ForeignKeyInfo from the given ResultSet

getTableNameForMetadata

protected String getTableNameForMetadata(String tableName)
Returns the table name that will be used for obtaining information from DatabaseMetaData.

getSchemaNameForMetadata

protected String getSchemaNameForMetadata(String schemaName)
Returns the schema name that will be used for obtaining information from DatabaseMetaData.

getCatalogNameForMetadata

protected String getCatalogNameForMetadata(String catalogName)
Returns the catalog name that will be used for obtaining information from DatabaseMetaData.

getColumnNameForMetadata

protected String getColumnNameForMetadata(String columnName)
Returns the column name that will be used for obtaining information from DatabaseMetaData.

beforeMetadataOperation

protected void beforeMetadataOperation(Connection c)

afterMetadataOperation

protected void afterMetadataOperation(Connection c)

supportsAutoIncrement

public boolean supportsAutoIncrement()
Return true if this dictionary supports auto increment columns. Returns false by default.

setLastGeneratedKeyQuery

public void setLastGeneratedKeyQuery(String lastGeneratedKeyQuery)
The query that will be used to query the last automatically generated key on the server. If this is set, then autoincrement support will be enabled for the database.

getLastGeneratedKeyQuery

public String getLastGeneratedKeyQuery()
The query that will be used to query the last automatically generated key on the server. If this is set, then autoincrement support will be enabled for the database.

getGeneratedKey

public long getGeneratedKey(Column col,
                            Connection conn)
                     throws SQLException
Return the last inserted auto increment value for the given column. Throws an exception by default if getLastGeneratedKeyQuery() returns null.

getLastGeneratedKeyQuery

public String getLastGeneratedKeyQuery(Column column)

setMaxCharactersInAutoIncrement

public void setMaxCharactersInAutoIncrement(int max)

getMaxCharactersInAutoIncrement

public int getMaxCharactersInAutoIncrement()

setAutoIncrementTypeName

public void setAutoIncrementTypeName(String autoIncrementTypeName)

getAutoIncrementTypeName

public String getAutoIncrementTypeName()

setAutoIncrementClause

public void setAutoIncrementClause(String autoIncrementClause)

getAutoIncrementClause

public String getAutoIncrementClause()

getGeneratedKeySequenceName

protected String getGeneratedKeySequenceName(Column col)
Return the sequence name used by databases for the given autoincrement column. This is only used by databases that require an explicit name to be used for auto-increment support.

replaceMapping

public ClassMapping replaceMapping(ClassMapping mapping)
Replace the given mapping with one suited to this database, or return the original if no replacement is needed. Returns the original by default.

replaceMapping

public FieldMapping replaceMapping(FieldMapping mapping)
Replace the given mapping with one suited to this database, or return the original if no replacement is needed. Returns the original by default.

replaceMappingFactory

public MappingFactory replaceMappingFactory(MappingFactory factory)
Replace the given factory with one suited to this database, or return the original if no replacement is needed. Returns the original by default.

replaceSchemaFactory

public SchemaFactory replaceSchemaFactory(SchemaFactory factory)
Replace the given factory with one suited to this database, or return the original if no replacement is needed. Returns the original by default.

setConfiguration

public void setConfiguration(Configuration conf)
Description copied from interface: Configurable
Invoked prior to setting bean properties.
Specified by:
setConfiguration in interface Configurable

startConfiguration

public void startConfiguration()
Description copied from interface: Configurable
Invoked before bean property configuration is begun on this object.
Specified by:
startConfiguration in interface Configurable

endConfiguration

public void endConfiguration()
Description copied from interface: Configurable
Invoked upon completion of bean property configuration for this object.
Specified by:
endConfiguration in interface Configurable

decorate

public Connection decorate(Connection conn)
                    throws SQLException
Decorate the given connection if needed. Some databases require special handling for JDBC bugs. This method will also issue any initialization SQL is the getInitializationSQL() method does not return null.
Specified by:
decorate in interface ConnectionDecorator

setBigintTypeName

public void setBigintTypeName(String bigintTypeName)
The schema definition name for Types.BIGINT.

getBigintTypeName

public String getBigintTypeName()
The schema definition name for Types.BIGINT.

setBinaryTypeName

public void setBinaryTypeName(String binaryTypeName)
The schema definition name for Types.BINARY.

getBinaryTypeName

public String getBinaryTypeName()
The schema definition name for Types.BINARY.

setBitTypeName

public void setBitTypeName(String bitTypeName)
The schema definition name for Types.BIT.

getBitTypeName

public String getBitTypeName()
The schema definition name for Types.BIT.

setBlobTypeName

public void setBlobTypeName(String blobTypeName)
The schema definition name for Types.BLOB.

getBlobTypeName

public String getBlobTypeName()
The schema definition name for Types.BLOB.

setCharTypeName

public void setCharTypeName(String charTypeName)
The schema definition name for Types.CHAR.

getCharTypeName

public String getCharTypeName()
The schema definition name for Types.CHAR.

setClobTypeName

public void setClobTypeName(String clobTypeName)
The schema definition name for Types.CLOB.

getClobTypeName

public String getClobTypeName()
The schema definition name for Types.CLOB.

setDateTypeName

public void setDateTypeName(String dateTypeName)
The schema definition name for Types.DATE.

getDateTypeName

public String getDateTypeName()
The schema definition name for Types.DATE.

setDecimalTypeName

public void setDecimalTypeName(String decimalTypeName)
The schema definition name for Types.DECIMAL.

getDecimalTypeName

public String getDecimalTypeName()
The schema definition name for Types.DECIMAL.

setDistinctTypeName

public void setDistinctTypeName(String distinctTypeName)
The schema definition name for Types.DISTINCT.

getDistinctTypeName

public String getDistinctTypeName()
The schema definition name for Types.DISTINCT.

setDoubleTypeName

public void setDoubleTypeName(String doubleTypeName)
The schema definition name for Types.DOUBLE.

getDoubleTypeName

public String getDoubleTypeName()
The schema definition name for Types.DOUBLE.

setFloatTypeName

public void setFloatTypeName(String floatTypeName)
The schema definition name for Types.FLOAT.

getFloatTypeName

public String getFloatTypeName()
The schema definition name for Types.FLOAT.

setIntegerTypeName

public void setIntegerTypeName(String integerTypeName)
The schema definition name for Types.INTEGER.

getIntegerTypeName

public String getIntegerTypeName()
The schema definition name for Types.INTEGER.

setJavaObjectTypeName

public void setJavaObjectTypeName(String javaObjectTypeName)
The schema definition name for Types.JAVA_OBJECT.

getJavaObjectTypeName

public String getJavaObjectTypeName()
The schema definition name for Types.JAVA_OBJECT.

setLongVarbinaryTypeName

public void setLongVarbinaryTypeName(String longVarbinaryTypeName)
The schema definition name for Types.LONGVARBINARY.

getLongVarbinaryTypeName

public String getLongVarbinaryTypeName()
The schema definition name for Types.LONGVARBINARY.

setLongVarcharTypeName

public void setLongVarcharTypeName(String longVarcharTypeName)
The schema definition name for Types.LONGVARCHAR.

getLongVarcharTypeName

public String getLongVarcharTypeName()
The schema definition name for Types.LONGVARCHAR.

setNullTypeName

public void setNullTypeName(String nullTypeName)
The schema definition name for Types.NULL.

getNullTypeName

public String getNullTypeName()
The schema definition name for Types.NULL.

setNumericTypeName

public void setNumericTypeName(String numericTypeName)
The schema definition name for Types.NUMERIC.

getNumericTypeName

public String getNumericTypeName()
The schema definition name for Types.NUMERIC.

setOtherTypeName

public void setOtherTypeName(String otherTypeName)
The schema definition name for Types.OTHER.

getOtherTypeName

public String getOtherTypeName()
The schema definition name for Types.OTHER.

setRealTypeName

public void setRealTypeName(String realTypeName)
The schema definition name for Types.REAL.

getRealTypeName

public String getRealTypeName()
The schema definition name for Types.REAL.

setRefTypeName

public void setRefTypeName(String refTypeName)
The schema definition name for Types.REF.

getRefTypeName

public String getRefTypeName()
The schema definition name for Types.REF.

setSmallintTypeName

public void setSmallintTypeName(String smallintTypeName)
The schema definition name for Types.SMALLINT.

getSmallintTypeName

public String getSmallintTypeName()
The schema definition name for Types.SMALLINT.

setStructTypeName

public void setStructTypeName(String structTypeName)
The schema definition name for Types.STRUCT.

getStructTypeName

public String getStructTypeName()
The schema definition name for Types.STRUCT.

setTimeTypeName

public void setTimeTypeName(String timeTypeName)
The schema definition name for Types.TIME.

getTimeTypeName

public String getTimeTypeName()
The schema definition name for Types.TIME.

setTimestampTypeName

public void setTimestampTypeName(String timestampTypeName)
The schema definition name for Types.TIMESTAMP.

getTimestampTypeName

public String getTimestampTypeName()
The schema definition name for Types.TIMESTAMP.

setTinyintTypeName

public void setTinyintTypeName(String tinyintTypeName)
The schema definition name for Types.TINYINT.

getTinyintTypeName

public String getTinyintTypeName()
The schema definition name for Types.TINYINT.

setVarbinaryTypeName

public void setVarbinaryTypeName(String varbinaryTypeName)
The schema definition name for Types.VARBINARY.

getVarbinaryTypeName

public String getVarbinaryTypeName()
The schema definition name for Types.VARBINARY.

setVarcharTypeName

public void setVarcharTypeName(String varcharTypeName)
The schema definition name for Types.VARCHAR.

getVarcharTypeName

public String getVarcharTypeName()
The schema definition name for Types.VARCHAR.

setUseGetBestRowIdentifierForPrimaryKeys

public void setUseGetBestRowIdentifierForPrimaryKeys(boolean useBestRow)

getUseGetBestRowIdentifierForPrimaryKeys

public boolean getUseGetBestRowIdentifierForPrimaryKeys()

setSupportsMultipleNontransactionalResultSets

public void setSupportsMultipleNontransactionalResultSets(boolean sup)
Whether this dictionary supports multiple result sets outside of a transaction.

getSupportsMultipleNontransactionalResultSets

public boolean getSupportsMultipleNontransactionalResultSets()
Whether this dictionary supports multiple result sets outside of a transaction.

setForUpdateClause

public void setForUpdateClause(String forUpdateClause)
The clause that is used for issuing "SELECT ... FOR UPDATE" statements.

getForUpdateClause

public String getForUpdateClause()
The clause that is used for issuing "SELECT ... FOR UPDATE" statements.

setSupportsSelectForUpdate

public void setSupportsSelectForUpdate(Boolean supportsSelectForUpdate)
Whether this dictionary supports "SELECT ... FOR UPDATE"

getSupportsSelectForUpdate

public Boolean getSupportsSelectForUpdate()
Whether this dictionary supports "SELECT ... FOR UPDATE"

setMaxIndexesPerTable

public void setMaxIndexesPerTable(int maxIndexesPerTable)
The maximum number of indexes that can be created for a single table, or Integer.MAX_VALUE if there is no limit.

getMaxIndexesPerTable

public int getMaxIndexesPerTable()
The maximum number of indexes that can be created for a single table, or Integer.MAX_VALUE if there is no limit.

setMaxKeyNameLength

public void setMaxKeyNameLength(Integer maxKeyNameLength)
The maximum number of characters in any key.

getMaxKeyNameLength

public Integer getMaxKeyNameLength()
The maximum number of characters in any key.

setSupportsLockingWithDistinctClause

public void setSupportsLockingWithDistinctClause(boolean support)
Whether this database supports "FOR UPDATE" queries with a "DISTINCT" clause.

getSupportsLockingWithDistinctClause

public boolean getSupportsLockingWithDistinctClause()
Whether this database supports "FOR UPDATE" queries with a "DISTINCT" clause.

setSupportsLockingWithMultipleTables

public void setSupportsLockingWithMultipleTables(boolean support)
Whether this database supports "FOR UPDATE" queries with multiple tables.

getSupportsLockingWithMultipleTables

public boolean getSupportsLockingWithMultipleTables()
Whether this database supports "FOR UPDATE" queries with multiple tables.

setSupportsLockingWithOrderClause

public void setSupportsLockingWithOrderClause(boolean support)
Whether this database supports "FOR UPDATE" queries with "ORDER BY" clauses.

getSupportsLockingWithOrderClause

public boolean getSupportsLockingWithOrderClause()
Whether this database supports "FOR UPDATE" queries with "ORDER BY" clauses.

setTableForUpdateClause

public void setTableForUpdateClause(String tableForUpdateClause)
The per-table clause to append to each table alias in a SELECT.

getTableForUpdateClause

public String getTableForUpdateClause()
The per-table clause to append to each table alias in a SELECT.

setSupportsLockingWithOuterJoin

public void setSupportsLockingWithOuterJoin(boolean sel)
Whether this database supports "FOR UPDATE" queries with outer joins.

getSupportsLockingWithOuterJoin

public boolean getSupportsLockingWithOuterJoin()
Whether this database supports "FOR UPDATE" queries with outer joins.

setSupportsLockingWithInnerJoin

public void setSupportsLockingWithInnerJoin(boolean sel)
Whether this database supports "FOR UPDATE" queries with inner joins.

getSupportsLockingWithInnerJoin

public boolean getSupportsLockingWithInnerJoin()
Whether this database supports "FOR UPDATE" queries with inner joins.

setSupportsNullTableForGetColumns

public void setSupportsNullTableForGetColumns(boolean sup)
If true, calls to ResultSet#getColumns can handle a null table.

getSupportsNullTableForGetColumns

public boolean getSupportsNullTableForGetColumns()
If true, calls to ResultSet#getColumns can handle a null table.

setSupportsNullTableForGetIndexInfo

public void setSupportsNullTableForGetIndexInfo(boolean sup)
If true, calls to ResultSet#getIndexInfo can handle a null table.

getSupportsNullTableForGetIndexInfo

public boolean getSupportsNullTableForGetIndexInfo()
If true, calls to ResultSet#getIndexInfo can handle a null table.

setSupportsNullTableForGetImportedKeys

public void setSupportsNullTableForGetImportedKeys(boolean sup)
If true, calls to ResultSet#getImportedKeys can handle a null table.

getSupportsNullTableForGetImportedKeys

public boolean getSupportsNullTableForGetImportedKeys()
If true, calls to ResultSet#getImportedKeys can handle a null table.

setSupportsNullTableForGetPrimaryKeys

public void setSupportsNullTableForGetPrimaryKeys(boolean sup)
If true, calls to ResultSet#getPrimaryKeys can handle a null table.

getSupportsNullTableForGetPrimaryKeys

public boolean getSupportsNullTableForGetPrimaryKeys()
If true, calls to ResultSet#getPrimaryKeys can handle a null table.

setInitializationSQL

public void setInitializationSQL(String initializationSQL)
SQL that will be issued to the database whenever a connection is made.

getInitializationSQL

public String getInitializationSQL()
SQL that will be issued to the database whenever a connection is made.

setUseSchemaName

public void setUseSchemaName(boolean useSchemaName)
Whether to use the schema name when constructing a full table name.

getUseSchemaName

public boolean getUseSchemaName()
Whether to use the schema name when constructing a full table name.

setSupportsSchemaForGetTables

public void setSupportsSchemaForGetTables(boolean sup)
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]). If false, disable the use of the schema name in these calls.

getSupportsSchemaForGetTables

public boolean getSupportsSchemaForGetTables()
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]). If false, disable the use of the schema name in these calls.

setSupportsSchemaForGetColumns

public void setSupportsSchemaForGetColumns(boolean sup)
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String). If false, disable the use of the schema name in these calls.

getSupportsSchemaForGetColumns

public boolean getSupportsSchemaForGetColumns()
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String). If false, disable the use of the schema name in these calls.

setRequiresAliasForSubselect

public void setRequiresAliasForSubselect(boolean requiresAliasForSubselect)
If true, then any subselect statements require that the subselect be assigned a table alias.

getRequiresAliasForSubselect

public boolean getRequiresAliasForSubselect()
If true, then any subselect statements require that the subselect be assigned a table alias.

setSupportsQueryTimeout

public void setSupportsQueryTimeout(boolean supportsQueryTimeout)
If true, then the JDBC driver supports Statement.setQueryTimeout(int)

getSupportsQueryTimeout

public boolean getSupportsQueryTimeout()
If true, then the JDBC driver supports Statement.setQueryTimeout(int)

setRequiresAutoCommitForMetadata

public void setRequiresAutoCommitForMetadata(boolean req)
If true, then a connection must have autocommit set to true in order to perform schema interrogation operations.

getRequiresAutoCommitForMetadata

public boolean getRequiresAutoCommitForMetadata()
If true, then a connection must have autocommit set to true in order to perform schema interrogation operations.

setDefaultSchemaName

public void setDefaultSchemaName(String defaultSchemaName)
The schema name to use for metadata operations if none is set.

getDefaultSchemaName

public String getDefaultSchemaName()
The schema name to use for metadata operations if none is set.

setNullTableName

public void setNullTableName(String nullTableName)
An identifer that represents a null table (such as "%").

getNullTableName

public String getNullTableName()
An identifer that represents a null table (such as "%").

setNullColumnName

public void setNullColumnName(String nullColumnName)
An identifer that represents a null column (such as "%").

getNullColumnName

public String getNullColumnName()
An identifer that represents a null column (such as "%").

setMaxCharactersInTableName

public void setMaxCharactersInTableName(Integer maxCharactersInTableName)
The maximum number of characters in a table name.

getMaxCharactersInTableName

public Integer getMaxCharactersInTableName()
The maximum number of characters in a table name.

SolarMetric Kodo JDO 3.1.6 generated on August 25 2004

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.