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
public class DB2Adapter extends JdbcAdapter
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 SummaryFields inherited from class org.apache.cayenne.dba.JdbcAdapterbatchQueryBuilderFactory, caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
- 
Constructor SummaryConstructors Constructor Description DB2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
- 
Method SummaryModifier and Type Method Description voidbindParameter(PreparedStatement statement, ParameterBinding binding)Binds an object value to PreparedStatement's parameter.protected voidconfigureExtendedTypes(ExtendedTypeMap map)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 PkGeneratorcreatePkGenerator()Creates a DB2 specific PK Generator.voidcreateTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column)Appends SQL for column creation to CREATE TABLE buffer.SQLActiongetAction(Query query, DataNode node)Uses special action builder to create the right action.EJBQLTranslatorFactorygetEjbqlTranslatorFactory()Returns a translator factory for EJBQL to SQL translation.QualifierTranslatorgetQualifierTranslator(QueryAssembler queryAssembler)Returns a trimming translator.booleantypeSupportsLength(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.JdbcAdapterbuildAttribute, createEJBQLTranslatorFactory, createFkConstraint, createQuotingStrategy, createTable, createTableAppendPKClause, createUniqueConstraint, dropTableStatements, externalTypesForJdbcType, findResource, getBatchTerminator, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSystemCatalogs, getSystemSchemas, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, unwrap
- 
Constructor Details- 
DB2Adapterpublic DB2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
 
- 
- 
Method Details- 
createPkGeneratorCreates a DB2 specific PK Generator.- Overrides:
- createPkGeneratorin class- JdbcAdapter
 
- 
configureExtendedTypesDescription copied from class:JdbcAdapterCalled 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:
- configureExtendedTypesin class- JdbcAdapter
 
- 
createTableAppendColumnDescription copied from class:JdbcAdapterAppends SQL for column creation to CREATE TABLE buffer.- Specified by:
- createTableAppendColumnin interface- DbAdapter
- Overrides:
- createTableAppendColumnin class- JdbcAdapter
- Parameters:
- sqlBuffer- the- StringBufferto append the column type to
- column- the- DbAttributedefining the column to append type for
- Since:
- 4.0
 
- 
typeSupportsLengthpublic boolean typeSupportsLength(int type)Description copied from class:JdbcAdapterReturns true if supplied type can have a length attribute as a part of column definition- Specified by:
- typeSupportsLengthin interface- DbAdapter
- Overrides:
- typeSupportsLengthin class- JdbcAdapter
- Since:
- 4.0
 
- 
getQualifierTranslatorReturns a trimming translator.- Specified by:
- getQualifierTranslatorin interface- DbAdapter
- Overrides:
- getQualifierTranslatorin class- JdbcAdapter
 
- 
getEjbqlTranslatorFactoryDescription copied from class:JdbcAdapterReturns 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:
- getEjbqlTranslatorFactoryin interface- DbAdapter
- Overrides:
- getEjbqlTranslatorFactoryin class- JdbcAdapter
- Since:
- 4.0
 
- 
bindParameterDescription copied from interface:DbAdapterBinds an object value to PreparedStatement's parameter.- Specified by:
- bindParameterin interface- DbAdapter
- Overrides:
- bindParameterin class- JdbcAdapter
- Throws:
- Exception
 
- 
getActionUses special action builder to create the right action.- Specified by:
- getActionin interface- DbAdapter
- Overrides:
- getActionin class- JdbcAdapter
- Since:
- 3.1
 
 
-