|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.adapter.DatabaseAdapter
org.datanucleus.store.rdbms.adapter.DB2Adapter
public class DB2Adapter
Provides methods for adapting SQL language elements to the DB2 database.
DatabaseAdapter| Field Summary | |
|---|---|
static String |
DB2_RESERVED_WORDS
A string containing the list of DB2 keywords This list is normally obtained dynamically from the driver using "DatabaseMetaData.getSQLKeywords()". |
| Fields inherited from class org.datanucleus.store.rdbms.adapter.DatabaseAdapter |
|---|
catalogSeparator, datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, driverMajorVersion, driverMinorVersion, driverName, driverVersion, identifierQuoteString, LOCALISER, LOCALISER_BASE, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, properties, reservedKeywords, supportedOptions |
| Fields inherited from interface org.datanucleus.store.mapped.DatastoreAdapter |
|---|
ANALYSIS_METHODS, BIT_IS_REALLY_BOOLEAN, BOOLEAN_COMPARISON, CATALOGS_IN_TABLE_DEFINITIONS, ESCAPE_EXPRESSION_IN_LIKE_PREDICATE, IDENTIFIERS_LOWERCASE, IDENTIFIERS_LOWERCASE_QUOTED, IDENTIFIERS_MIXEDCASE, IDENTIFIERS_MIXEDCASE_QUOTED, IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE, IDENTIFIERS_MIXEDCASE_SENSITIVE, IDENTIFIERS_UPPERCASE, IDENTIFIERS_UPPERCASE_QUOTED, IDENTITY_COLUMNS, PROJECTION_IN_TABLE_REFERENCE_JOINS, SCHEMAS_IN_TABLE_DEFINITIONS, SEQUENCES |
| Constructor Summary | |
|---|---|
DB2Adapter(DatabaseMetaData metadata)
Constructs a DB2 adapter based on the given JDBC metadata. |
|
| Method Summary | |
|---|---|
String |
getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...). |
String |
getAutoIncrementStmt(Table table,
String columnName)
Accessor for the auto-increment sql statement for this datastore. |
String |
getContinuationString()
Continuation string to use where the SQL statement goes over more than 1 line. |
int |
getDatastoreIdentifierMaxLength(org.datanucleus.store.mapped.IdentifierType identifierType)
Method to return the maximum length of a datastore identifier of the specified type. |
String |
getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
Returns the appropriate SQL to drop the given table. |
String |
getRangeByRowNumberColumn()
Method to return the column name to use when handling ranges via a rownumber on the select using the original method (DB2). |
String |
getSchemaName(Connection conn)
Accessor for the Schema Name for this datastore. |
String |
getSequenceCreateStmt(String sequence_name,
Integer min,
Integer max,
Integer start,
Integer increment,
Integer cache_size)
Accessor for the sequence statement to create the sequence. |
String |
getSequenceNextStmt(String sequence_name)
Accessor for the statement for getting the next id from the sequence for this datastore. |
String |
getVendorID()
|
void |
initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
Initialise the types for this datastore. |
boolean |
isStatementCancel(SQLException sqle)
return whether this exception represents a cancelled statement. |
boolean |
isStatementTimeout(SQLException sqle)
return whether this exception represents a timed out statement. |
RDBMSColumnInfo |
newRDBMSColumnInfo(ResultSet rs)
Method to create a column info for the current row. |
SQLTypeInfo |
newSQLTypeInfo(ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DB2_RESERVED_WORDS
| Constructor Detail |
|---|
public DB2Adapter(DatabaseMetaData metadata)
metadata - the database metadata.| Method Detail |
|---|
public void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
initialiseTypes in interface org.datanucleus.store.mapped.DatastoreAdapterinitialiseTypes in class DatabaseAdapterhandler - SchemaHandler that we initialise the types formconn - Managed connection to usepublic String getVendorID()
getVendorID in interface org.datanucleus.store.mapped.DatastoreAdaptergetVendorID in class DatabaseAdapter
public String getSchemaName(Connection conn)
throws SQLException
DatabaseAdapter
getSchemaName in interface RDBMSAdaptergetSchemaName in class DatabaseAdapterconn - Connection to the datastore
SQLException - Thrown if error occurs in determining the schema name.public int getDatastoreIdentifierMaxLength(org.datanucleus.store.mapped.IdentifierType identifierType)
getDatastoreIdentifierMaxLength in interface org.datanucleus.store.mapped.DatastoreAdaptergetDatastoreIdentifierMaxLength in class DatabaseAdapteridentifierType - Type of identifier (see IdentifierFactory.TABLE, etc)
public SQLTypeInfo newSQLTypeInfo(ResultSet rs)
RDBMSAdapter
newSQLTypeInfo in interface RDBMSAdapternewSQLTypeInfo in class DatabaseAdapterrs - ResultSet
public RDBMSColumnInfo newRDBMSColumnInfo(ResultSet rs)
newRDBMSColumnInfo in interface RDBMSAdapternewRDBMSColumnInfo in class DatabaseAdapterrs - ResultSet from DatabaseMetaData.getColumns()
public String getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
DatabaseAdapter
DROP TABLE FOO CASCADE
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table to drop.
public String getAutoIncrementStmt(Table table,
String columnName)
getAutoIncrementStmt in interface RDBMSAdaptergetAutoIncrementStmt in class DatabaseAdaptertable - Name of the table that the autoincrement is forcolumnName - Name of the column that the autoincrement is for
public String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdaptergetAutoIncrementKeyword in class DatabaseAdapterpublic String getContinuationString()
getContinuationString in class DatabaseAdapter
public String getSequenceCreateStmt(String sequence_name,
Integer min,
Integer max,
Integer start,
Integer increment,
Integer cache_size)
getSequenceCreateStmt in interface RDBMSAdaptergetSequenceCreateStmt in class DatabaseAdaptersequence_name - Name of the sequencemin - Minimum value for the sequencemax - Maximum value for the sequencestart - Start value for the sequenceincrement - Increment value for the sequencecache_size - Cache size for the sequence
public String getSequenceNextStmt(String sequence_name)
getSequenceNextStmt in interface RDBMSAdaptergetSequenceNextStmt in class DatabaseAdaptersequence_name - Name of the sequence
public String getRangeByRowNumberColumn()
DatabaseAdapter
getRangeByRowNumberColumn in interface RDBMSAdaptergetRangeByRowNumberColumn in class DatabaseAdapterpublic boolean isStatementCancel(SQLException sqle)
isStatementCancel in interface RDBMSAdapterisStatementCancel in class DatabaseAdaptersqle - the exception
public boolean isStatementTimeout(SQLException sqle)
DatabaseAdapter
isStatementTimeout in interface RDBMSAdapterisStatementTimeout in class DatabaseAdaptersqle - the exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||