Package org.apache.cayenne.dba.db2
Class DB2Adapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.db2.DB2Adapter
- All Implemented Interfaces:
DbAdapter
DbAdapter implementation for the DB2 RDBMS .
Sample connection settings to use with DB2 are shown below:
test-db2.jdbc.username = test test-db2.jdbc.password = secret test-db2.jdbc.url = jdbc:db2://servername:50000/databasename test-db2.jdbc.driver = com.ibm.db2.jcc.DB2Driver
-
Field Summary
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
batchQueryBuilderFactory, caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
-
Constructor Summary
ConstructorDescriptionDB2Adapter
(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
bindParameter
(PreparedStatement statement, ParameterBinding binding) Binds an object value to PreparedStatement's parameter.protected void
Called fromJdbcAdapter.initExtendedTypes(List, List, List, ValueObjectTypeRegistry)
to load adapter-specific types into the ExtendedTypeMap right after the default types are loaded, but before the DI overrides are.protected PkGenerator
Creates a DB2 specific PK Generator.void
createTableAppendColumn
(StringBuffer sqlBuffer, DbAttribute column) Appends SQL for column creation to CREATE TABLE buffer.Uses special action builder to create the right action.Returns a translator factory for EJBQL to SQL translation.boolean
typeSupportsLength
(int type) Returns true if supplied type can have a length attribute as a part of column definitionMethods inherited from class org.apache.cayenne.dba.JdbcAdapter
buildAttribute, createEJBQLTranslatorFactory, createFkConstraint, createQuotingStrategy, createTable, createTableAppendPKClause, createUniqueConstraint, dropTableStatements, externalTypesForJdbcType, findResource, getBatchTerminator, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSelectTranslator, getSystemCatalogs, getSystemSchemas, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cayenne.dba.DbAdapter
supportsGeneratedKeysForBatchInserts
-
Constructor Details
-
DB2Adapter
public DB2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
-
-
Method Details
-
createPkGenerator
Creates a DB2 specific PK Generator.- Overrides:
createPkGenerator
in classJdbcAdapter
-
configureExtendedTypes
Description copied from class:JdbcAdapter
Called fromJdbcAdapter.initExtendedTypes(List, List, List, ValueObjectTypeRegistry)
to load adapter-specific types into the ExtendedTypeMap right after the default types are loaded, but before the DI overrides are. This method has specific implementations in JdbcAdapter subclasses.- Overrides:
configureExtendedTypes
in classJdbcAdapter
-
createTableAppendColumn
Description copied from class:JdbcAdapter
Appends SQL for column creation to CREATE TABLE buffer.- Specified by:
createTableAppendColumn
in interfaceDbAdapter
- Overrides:
createTableAppendColumn
in classJdbcAdapter
- Parameters:
sqlBuffer
- theStringBuffer
to append the column type tocolumn
- theDbAttribute
defining the column to append type for- Since:
- 4.0
-
typeSupportsLength
public boolean typeSupportsLength(int type) Description copied from class:JdbcAdapter
Returns true if supplied type can have a length attribute as a part of column definition- Specified by:
typeSupportsLength
in interfaceDbAdapter
- Overrides:
typeSupportsLength
in classJdbcAdapter
- Since:
- 4.0
-
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessor
in interfaceDbAdapter
- Overrides:
getSqlTreeProcessor
in classJdbcAdapter
- Returns:
SQLTreeProcessor
that can adjust SQL tree to specific database flavour- Since:
- 4.2
-
getEjbqlTranslatorFactory
Description copied from class:JdbcAdapter
Returns a translator factory for EJBQL to SQL translation. The factory is normally initialized in constructor by callingJdbcAdapter.createEJBQLTranslatorFactory()
, and can be changed later by callingJdbcAdapter.setEjbqlTranslatorFactory(EJBQLTranslatorFactory)
.- Specified by:
getEjbqlTranslatorFactory
in interfaceDbAdapter
- Overrides:
getEjbqlTranslatorFactory
in classJdbcAdapter
- Since:
- 4.0
-
bindParameter
Description copied from interface:DbAdapter
Binds an object value to PreparedStatement's parameter.- Specified by:
bindParameter
in interfaceDbAdapter
- Overrides:
bindParameter
in classJdbcAdapter
- Throws:
Exception
-
getAction
Uses special action builder to create the right action.- Specified by:
getAction
in interfaceDbAdapter
- Overrides:
getAction
in classJdbcAdapter
- Since:
- 3.1
-