Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.0.0)

E10653-01

oracle.jbo.server
Class DB2SQLBuilderImpl

java.lang.Object
  extended by oracle.jbo.common.CommonCriteriaAdapter
      extended by oracle.jbo.server.BaseSQLBuilderImpl
          extended by oracle.jbo.server.SQL92SQLBuilderImpl
              extended by oracle.jbo.server.DB2SQLBuilderImpl
All Implemented Interfaces:
CriteriaAdapter, SQLBuilder, ViewCriteriaAdapter

public class DB2SQLBuilderImpl
extends SQL92SQLBuilderImpl

DB2 specific implementation of the SQLBuilder interface.

Since:
JDeveloper 3.2

Field Summary
 
Fields inherited from class oracle.jbo.server.SQL92SQLBuilderImpl
ERROR_OLITE_RESOURCE_BUSY_AND_NOWAIT_SPECIFIED, mSQLBuilderInterface, ORACLE_ROWID_COLUMN
 
Fields inherited from interface oracle.jbo.server.SQLBuilder
BINDING_STYLE_JDBC, BINDING_STYLE_ORACLE, BINDING_STYLE_ORACLE_NAME, BINDING_STYLE_UNKNOWN, DML_DELETE, DML_INSERT, DML_UPDATE
 
Constructor Summary
DB2SQLBuilderImpl()
           
 
Method Summary
 java.lang.String buildEffDtDateDayAddStatement()
          Returns a statement that returns a date that is 'x' number of days apart from the specified date.
 java.lang.String getClauseForDateLiteral(java.util.Date date)
          Creates a database platform specific clause for converting a date string literal to date datatype.
 java.util.ArrayList getConstraintsList(java.sql.Connection conn, java.lang.String catalog, java.lang.String user_or_schema, java.lang.String full_tablename)
          Return vector with constraint details for this table where each detail is in a String array with this structure: 0 String owner
 java.lang.String getDbTimeQuery()
          Returns a SQL statement to obtain the current time from the database.
 java.lang.String getDbType()
          Returns a string uniquely identifying this type of SQLBuilder.
static SQLBuilder getInterface()
          Gets the singleton instance of this class.
protected  java.lang.String getJDBCDriverClassName(java.lang.String url)
          Concrete implementations of SQLBuilder must elect a default driver name.
 java.lang.String getPersistManagerClassName()
          Returns the name of default PersistManager class name.
protected  java.lang.String getSqlVariantLockTrailer()
          Returns the lock trailer from the System properties.
 java.lang.String getVersion()
          Gets a string describing the version of this implentation of this interface.
 boolean isNewLineAllowedInSQL(java.sql.Connection conn)
          Checks if the JDBC driver supports new line character in SQL statements.
 void releaseSavepoint(java.sql.Connection conn, java.lang.String id)
          Release SAVEPOINT if possible.
 void rollbackToSavepoint(java.sql.Connection conn, java.lang.String id)
          Rollback to SAVEPOINT if possible.
 void setSavepoint(java.sql.Connection conn, java.lang.String id)
          Issue a SAVEPOINT if possible.
 
Methods inherited from class oracle.jbo.server.SQL92SQLBuilderImpl
getCreateSequenceInsertTriggerSQL, getCreateSequenceSQL, getDropSequenceSQL, getDropTableSQL, getQueryHitCountSQL, getTypeMapName, isDisplayBindValueUI
 
Methods inherited from class oracle.jbo.server.BaseSQLBuilderImpl
baseBuildSelectList, bindDeleteStatement, bindEffDtDateDayAddStatement, bindInsertStatement, bindOptUpdateWhereClause, bindParametersForStmt, bindParamValue, bindUpdateStatement, bindWhereAttrValue, bindWhereClause, bindWhereClause, buildDefaultViewObjectFromClause, buildDefaultViewObjectFromClause, buildDefaultViewObjectWhereClause, buildDeleteStatement, buildInsertStatement, buildOptUpdateWhereClause, buildSelectList, buildSelectString, buildSelectString, buildUpdateStatement, buildWhereClause, capabilityCanReuseLockStatements, checkTableNameForQuotes, compareFetchedValue, convertFlags, convertValueToStorageType, convertValueToWhereFragment, convertValueToWhereFragment, createHandleForCancellableStatements, doEntityDML, doEntitySelect, doEntitySelectForAltKey, doLoadBulkFromResultSet, doLoadFromResultSet, doLoadFromStatement, doPreparedStatementDefineColumnType, doPreparedStatementDefines, doRefreshSQL, doRegisterDefaultDriver, doStatementSetBindingStyle, doStatementSetBindingStyleDefault, doStatementSetRowPrefetch, dumpConstraint, executeBatch, formatAttributeValue, generatePKBasedRef, generateRefAndOID, generateRowID, getBaseTable, getBindingStyleValue, getColumnNameWithFormatForQuery, getConstraints, getCurrentDbTime, getDBOperationList, getDBPackageList, getDefaultBindingStyle, getFormattedLHSCompareFragment, getFormattedLHSCompareFragment, getFormattedLHSCompareFragment, getFormattedRHSCompareFragment, getFormattedRHSCompareFragment, getFormattedRHSCompareFragment, getLockTrailerIsAtEnd, getMaxTableNameLength, getNestedTables, getQuotationMarkLeft, getQuotationMarkRight, getROWID, getSchemaList, getSchemas, getSupportsAliasInUpdateStatements, getTableList, getTableList, getTables, getTables, getTables, getTables, getViewCriteriaAdapter, getViewCriteriaClause, getWarningText, getWhereFragmentFromVO, invalidDatumFactoryUsage, isConnectionAlive, isCriteriaItemOuterJoined, isDataSourceJTABased, isLHSFragmentOptional, isNCharType, isStreamType, jdbcClientSideSecurity, lookupDataSource, needsQuotedTableName, populateCompOpers, populateJboTypeMapEntries, processException, registerDatabaseChangeListener, setSessionTimeZone, setupBindVarExtendedData, shouldPutJoinConstraintInFromClause, shouldSkipDML, supportsReturningClause, supportsRowNumQuery
 
Methods inherited from class oracle.jbo.common.CommonCriteriaAdapter
cleanUpTemporaryBindVars, convertCriteriaItemToWhereFragment, convertOpandRHSToWhereFragment, convertValueToWhereFragment, correctOprandLiteral, createTempBindVar, createTemporaryBindVar, getCriteriaClause, getCriteriaClause, getOptionalItemClause, isCharType, isDateType, isNumericType, parseOperatorAndValueFromItemValue, shouldUseTempBindVariableForValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.server.SQLBuilder
isCharType, isNumericType
 

Constructor Detail

DB2SQLBuilderImpl

public DB2SQLBuilderImpl()
Method Detail

getInterface

public static SQLBuilder getInterface()
Gets the singleton instance of this class.

Returns:
a SQLBuilder object.

getVersion

public java.lang.String getVersion()
Description copied from interface: SQLBuilder
Gets a string describing the version of this implentation of this interface.

Specified by:
getVersion in interface SQLBuilder
Overrides:
getVersion in class SQL92SQLBuilderImpl
Returns:
a String containing the version.

getDbType

public java.lang.String getDbType()
Description copied from interface: SQLBuilder
Returns a string uniquely identifying this type of SQLBuilder. Examples are: "Oracle", "OLite", "SQL92".

Specified by:
getDbType in interface SQLBuilder
Overrides:
getDbType in class SQL92SQLBuilderImpl
Returns:
a String containing the Database type.

getPersistManagerClassName

public java.lang.String getPersistManagerClassName()
Description copied from interface: SQLBuilder
Returns the name of default PersistManager class name.

Specified by:
getPersistManagerClassName in interface SQLBuilder
Overrides:
getPersistManagerClassName in class SQL92SQLBuilderImpl
Returns:
a String containing the Class name.

getJDBCDriverClassName

protected java.lang.String getJDBCDriverClassName(java.lang.String url)
Description copied from class: BaseSQLBuilderImpl
Concrete implementations of SQLBuilder must elect a default driver name.

Overrides:
getJDBCDriverClassName in class SQL92SQLBuilderImpl
Parameters:
url - JDBC Connection url.
Returns:
the default driver class name based on the url and database flavor.

setSavepoint

public void setSavepoint(java.sql.Connection conn,
                         java.lang.String id)
                  throws java.sql.SQLException
Description copied from interface: SQLBuilder
Issue a SAVEPOINT if possible.

Specified by:
setSavepoint in interface SQLBuilder
Overrides:
setSavepoint in class BaseSQLBuilderImpl
Parameters:
conn - the Connection used to create a savepoint.
id - the id for a savepoint.
Throws:
java.sql.SQLException

rollbackToSavepoint

public void rollbackToSavepoint(java.sql.Connection conn,
                                java.lang.String id)
                         throws java.sql.SQLException
Description copied from interface: SQLBuilder
Rollback to SAVEPOINT if possible.

Specified by:
rollbackToSavepoint in interface SQLBuilder
Overrides:
rollbackToSavepoint in class BaseSQLBuilderImpl
Parameters:
conn - the Connection used to rollback the savepoint.
id - the id for a savepoint
Throws:
java.sql.SQLException

releaseSavepoint

public void releaseSavepoint(java.sql.Connection conn,
                             java.lang.String id)
                      throws java.sql.SQLException
Description copied from interface: SQLBuilder
Release SAVEPOINT if possible.

Specified by:
releaseSavepoint in interface SQLBuilder
Overrides:
releaseSavepoint in class BaseSQLBuilderImpl
Parameters:
conn - the Connection used to release the savepoint.
id - the id for a savepoint
Throws:
java.sql.SQLException

getSqlVariantLockTrailer

protected java.lang.String getSqlVariantLockTrailer()
Description copied from class: SQL92SQLBuilderImpl
Returns the lock trailer from the System properties. Subclasses override this method to provide database specific trailer.

Overrides:
getSqlVariantLockTrailer in class SQL92SQLBuilderImpl
Returns:
SQL clause to lock a row in the database.

getDbTimeQuery

public java.lang.String getDbTimeQuery()
Description copied from class: BaseSQLBuilderImpl
Returns a SQL statement to obtain the current time from the database.

Overrides:
getDbTimeQuery in class SQL92SQLBuilderImpl
Returns:
a String containing the SQL statement.

isNewLineAllowedInSQL

public boolean isNewLineAllowedInSQL(java.sql.Connection conn)
Description copied from interface: SQLBuilder
Checks if the JDBC driver supports new line character in SQL statements. Over-ridden by DB2SQLBuilderImpl to return false when using DB2 Universal Driver (Type IV).

Specified by:
isNewLineAllowedInSQL in interface SQLBuilder
Overrides:
isNewLineAllowedInSQL in class BaseSQLBuilderImpl
Parameters:
conn - the Database connection object
Returns:
true if the driver supports a new line character

getConstraintsList

public java.util.ArrayList getConstraintsList(java.sql.Connection conn,
                                              java.lang.String catalog,
                                              java.lang.String user_or_schema,
                                              java.lang.String full_tablename)
                                       throws java.sql.SQLException
Description copied from interface: SQLBuilder
Return vector with constraint details for this table where each detail is in a String array with this structure: 0 String owner

1 String constraint_name

2 String constraint_type

3 String table_name

4 String search_condition

5 Integer delete_rule (cascade)

6 Integer status (enabled)

7 Integerdeferrable

8 Integer deferred

9 Integer validated

10 String column_name

11 Integer position

12 String fkname

13 String fkother

Note: this method is subject to change.

Specified by:
getConstraintsList in interface SQLBuilder
Overrides:
getConstraintsList in class BaseSQLBuilderImpl
Parameters:
conn - the connection object.
catalog - the database catalog.
user_or_schema - the database schema.
full_tablename - the name of the table.
Returns:
an ArrayList containing an array of String objects.
Throws:
java.sql.SQLException

buildEffDtDateDayAddStatement

public java.lang.String buildEffDtDateDayAddStatement()
Description copied from interface: SQLBuilder
Returns a statement that returns a date that is 'x' number of days apart from the specified date.

Specified by:
buildEffDtDateDayAddStatement in interface SQLBuilder
Overrides:
buildEffDtDateDayAddStatement in class SQL92SQLBuilderImpl
Returns:
A String that contains the necessary SQL.

getClauseForDateLiteral

public java.lang.String getClauseForDateLiteral(java.util.Date date)
Description copied from interface: SQLBuilder
Creates a database platform specific clause for converting a date string literal to date datatype. May be used in date comparisions and other manipulations.

Specified by:
getClauseForDateLiteral in interface SQLBuilder
Overrides:
getClauseForDateLiteral in class SQL92SQLBuilderImpl
Parameters:
date - The date object that will be formatted and passed as a String
Returns:
A string representing the clause to be used while building the query statement.

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.0.0)

E10653-01

Copyright © 1997, 2008, Oracle. All rights reserved.