org.apache.cayenne.dba.db2
Class DB2Adapter

java.lang.Object
  extended by org.apache.cayenne.dba.JdbcAdapter
      extended by 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.cayenne.adapter = org.apache.cayenne.dba.db2.DB2Adapter
       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
ejbqlTranslatorFactory, extendedTypes, identifiersEndQuote, identifiersStartQuote, pkGenerator, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
 
Constructor Summary
DB2Adapter()
           
 
Method Summary
 void bindParameter(PreparedStatement statement, Object object, int pos, int sqlType, int precision)
          Binds an object value to PreparedStatement's numbered parameter.
protected  void configureExtendedTypes(ExtendedTypeMap map)
          Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.
protected  PkGenerator createPkGenerator()
          Creates a DB2 specific PK Generator.
 String createTable(DbEntity ent)
          Returns a SQL string that can be used to create database table corresponding to ent parameter.
 QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
          Returns a trimming translator.
 MergerFactory mergerFactory()
           
 
Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
buildAttribute, createEJBQLTranslatorFactory, createFkConstraint, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, dropTable, dropTableStatements, externalTypesForJdbcType, findAdapterResource, findResource, getAction, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getIdentifiersEndQuote, getIdentifiersStartQuote, getPkGenerator, getQuotingStrategy, initIdentifiersQuotes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsFkConstraints, setSupportsGeneratedKeys, setSupportsUniqueConstraints, supportsBatchUpdates, supportsFkConstraints, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2Adapter

public DB2Adapter()
Method Detail

createPkGenerator

protected PkGenerator createPkGenerator()
Creates a DB2 specific PK Generator.

Overrides:
createPkGenerator in class JdbcAdapter

configureExtendedTypes

protected void configureExtendedTypes(ExtendedTypeMap map)
Description copied from class: JdbcAdapter
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers. Called from default constructor.

Overrides:
configureExtendedTypes in class JdbcAdapter

createTable

public String createTable(DbEntity ent)
Returns a SQL string that can be used to create database table corresponding to ent parameter.

Specified by:
createTable in interface DbAdapter
Overrides:
createTable in class JdbcAdapter

getQualifierTranslator

public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
Returns a trimming translator.

Specified by:
getQualifierTranslator in interface DbAdapter
Overrides:
getQualifierTranslator in class JdbcAdapter

mergerFactory

public MergerFactory mergerFactory()
Specified by:
mergerFactory in interface DbAdapter
Overrides:
mergerFactory in class JdbcAdapter

bindParameter

public void bindParameter(PreparedStatement statement,
                          Object object,
                          int pos,
                          int sqlType,
                          int precision)
                   throws SQLException,
                          Exception
Description copied from interface: DbAdapter
Binds an object value to PreparedStatement's numbered parameter.

Specified by:
bindParameter in interface DbAdapter
Overrides:
bindParameter in class JdbcAdapter
Throws:
SQLException
Exception


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.