| java.lang.Object com.versant.core.jdbc.sql.SqlDriver
All known Subclasses: com.versant.core.jdbc.sql.SybaseSqlDriver, com.versant.core.jdbc.sql.OracleSqlDriver, com.versant.core.jdbc.sql.InterbaseSqlDriver, com.versant.core.jdbc.sql.MySqlSqlDriver, com.versant.core.jdbc.sql.SapDbSqlDriver, com.versant.core.jdbc.sql.InformixSqlDriver, com.versant.core.jdbc.sql.MsSqlDriver, com.versant.core.jdbc.sql.MckoiSqlDriver, com.versant.core.jdbc.sql.PostgresSqlDriver, com.versant.core.jdbc.sql.DaffodilSqlDriver, com.versant.core.jdbc.sql.CacheSqlDriver, com.versant.core.jdbc.sql.PointbaseSqlDriver, com.versant.core.jdbc.sql.HypersonicSqlDriver, com.versant.core.jdbc.sql.InformixSESqlDriver, com.versant.core.jdbc.sql.InstantDbSqlDriver, com.versant.core.jdbc.sql.DB2SqlDriver,
SqlDriver | abstract public class SqlDriver (Code) | | This is the base class for the classes responsible for generating SQL
for different databases and interfacing to JDBC drivers. There is normally
one shared instance per Store. This class is also responsible for creating
columns for fields and so on during meta data generation.
|
Method Summary | |
protected void | add(HashMap ans, JdbcJavaTypeMapping m) Add m to ans using its javaType as the key. | protected void | addPrimaryKeyConstraint(JdbcTable t, CharBuf s) Add the primary key constraint in isolation. | protected void | appendAddNewColumn(JdbcTable t, JdbcColumn c, CharBuf s, boolean comments) Append a column that needs to be added. | protected void | appendColumnNameList(JdbcColumn[] cols, CharBuf s) Append a comma separated list of column names to s. | protected void | appendColumnType(JdbcColumn c, CharBuf s) Append the column type part of a create table statement for a column. | protected void | appendColumnType(JdbcColumn c, CharBuf s, boolean useZeroScale) Append the column type part of a create table statement for a column. | protected void | appendCreateColumn(JdbcTable t, JdbcColumn c, CharBuf s, boolean comments) Append the part of a create table statement for a column. | protected void | appendCreateColumnAutoInc(JdbcTable t, JdbcColumn c, CharBuf s) Append the column auto increment part of a create table statement for a
column. | protected void | appendCreateColumnNulls(JdbcTable t, JdbcColumn c, CharBuf s) Append the allow nulls part of the definition for a column in a
create table statement. | protected void | appendCreateIndex(CharBuf s, JdbcTable t, JdbcIndex idx, boolean comments) Generate a 'create index' statement for idx. | protected void | appendDropColumn(TableDiff tableDiff, JdbcColumn c, CharBuf s, boolean comments) Append a column that needs to be added. | protected void | appendDropIndex(CharBuf s, JdbcTable t, JdbcIndex idx, boolean comments) Generate a 'drop index' statement for idx. | protected void | appendIndexesInCreateTable(JdbcTable t, CharBuf s) Hook for drivers that must create indexes in the create table
statement (e.g. | protected void | appendModifyColumn(TableDiff tableDiff, ColumnDiff diff, CharBuf s, boolean comments) Append a column that needs to be added. | protected void | appendPrimaryKeyConstraint(JdbcTable t, CharBuf s) Add the primary key constraint part of a create table statement to s. | protected void | appendRefConstraint(CharBuf s, JdbcConstraint c) Append an 'add constraint' statement for c. | protected void | appendRefDropConstraint(CharBuf s, JdbcConstraint c, boolean comments) Append an 'drop constraint' statement for c. | public void | appendSqlColumn(JdbcColumn col, String alias, CharBuf s) Append the name of the column to s. | public void | appendSqlFrom(JdbcTable table, String alias, CharBuf s) Append the from list entry for a table. | public void | appendSqlFromJoin(JdbcTable table, String alias, SqlExp exp, boolean outer, CharBuf s) Append the from list entry for a table that is the right hand table
in a join i.e. | public void | appendSqlJoin(String leftAlias, JdbcColumn left, String rightAlias, JdbcColumn right, boolean outer, CharBuf s) Append a join expression. | public void | appendSqlLiteral(int type, String value, CharBuf s) Append the value of the literal to s. | protected void | appendTableType(JdbcTable t, CharBuf s) Hook for drivers that have to append a table type to the create table
statement (e.g. | public void | appendWhereParam(CharBuf s, JdbcColumn c) Append a replacable parameter part of a where clause for the column.
This gives the driver a chance to embed type conversions and so on
for types not handled well by the JDBC driver (e.g. | public boolean | checkDDL(ArrayList tables, Connection con, PrintWriter errors, PrintWriter fix, ControlParams params) | public boolean | checkDDLForStartup(ArrayList tables, Connection con, PrintWriter out, PrintWriter fix, ControlParams params) Make sure the database tables and columns exist. | public boolean | checkLenght(JdbcColumn ourCol, JdbcColumn dbCol) | public boolean | checkNulls(JdbcColumn ourCol, JdbcColumn dbCol) | public boolean | checkScale(JdbcColumn ourCol, JdbcColumn dbCol) | protected boolean | checkTable(JdbcTable t, Statement stat, PrintWriter out) Check that the columns of t match those in the database schema. | public boolean | checkType(JdbcColumn ourCol, JdbcColumn dbCol) | public void | cleanupForGetQueryPlan(Connection con) Cleanup anything done in prepareForGetQueryPlan. | public String | comment(String msg) Format a comment. | protected DefaultJdbcNameGenerator | createDefaultJdbcNameGenerator() | public static Driver | createJdbcDriver(String name, ClassLoader cl) Load a JDBC driver class and create an instance of it. | public JdbcNameGenerator | createJdbcNameGenerator() Create a default name generator instance for JdbcStore's using this
driver. | public static SqlDriver | createSqlDriver(String name, Driver jdbcDriver) Create a SqlDriver instance by name. | public void | customizeForServer(Connection con) Perform any specific configuration appropriate for the database server
in use. | public static RuntimeException | defaultMapException(Throwable cause, String message, boolean isFatal) Maps a backend exception to a specific JDO exception.
This is the default implementation which is used if no SqlDriver
instance is available.
Parameters: cause - the backend exception Parameters: message - error message. | protected void | dropPrimaryKeyConstraint(JdbcTable t, CharBuf s) Drop the primary key constraint in isolation. | public void | dropTable(Connection con, String table) Drop the table and all its constraints etc. | protected void | dropTable(Connection con, String table, Statement stat) Drop the table and all its constraints etc. | public void | enableIdentityInsert(Connection con, String table, boolean on) Enable or disable identity insert for the given table if this is
required to insert a value into an identity column. | public void | fillDatabaseMetaData(ArrayList tables, HashMap dbMap) | public void | fixAllNames(HashMap nameMap) | protected void | fixColumnsNonDirect(TableDiff tableDiff, PrintWriter out) | protected void | fixConstraintsForNonDirectColumns(TableDiff tableDiff, PrintWriter out, boolean drop) | protected void | fixCoulumns(TableDiff tableDiff, PrintWriter out) | protected void | fixIndexForNonDirectColumns(TableDiff tableDiff, PrintWriter out, boolean drop) | public void | generateConstraints(JdbcTable t, Statement stat, PrintWriter out, boolean comments) Generate the 'add constraint' statements for t. | public void | generateCreateIndexes(JdbcTable t, Statement stat, PrintWriter out, boolean comments) Generate the 'create index' statements for t. | public void | generateCreateTable(JdbcTable t, Statement stat, PrintWriter out, boolean comments) Generate a 'create table' statement for t. | public void | generateDDL(ArrayList tables, Connection con, PrintWriter out, boolean comments) Generate SQL to create the database schema for the supplied tables. | public int | getAggregateTypeCode(int aggType, int currentTypeCode) Calculate the typeCode for a aggregate expression. | public String | getAliasPrepend() | public Object | getAutoIncColumnValue(JdbcTable classTable, Connection con, Statement stat) Retrieve the value of the autoinc or serial column for a row just
inserted using stat on con. | public String | getAutoIncPostInsertSQLSuffix(JdbcTable classTable) Get extra SQL to be appended to the insert statement for retrieving
the value of an autoinc column after insert. | protected String | getCatalog(Connection con) | protected ColumnDiff | getColumnDiffForName(TableDiff tableDiff, String name) | public String | getConnectionInitSQL() Get default SQL used to init a connection or null if none required. | public String | getConnectionValidateSQL() Get default SQL to test a connection or null if none available. | protected ConstraintDiff | getConstraintDiffForName(TableDiff tableDiff, String name, boolean db) | public HashMap | getDBSchema(Connection con, ControlParams params) Get the JdbcTable from the database for the given database connection and table name. | public HashMap | getDatabaseMetaData(ArrayList tables, Connection con) Get all the database tables and columns that is not system tables
and that is filled with what field it belongs to. | protected String | getDefaultForType(JdbcColumn ourCol) | public int | getDefaultPsCacheMax() | protected String | getDefaultValueComment() | public static String | getDriverFromURL(String url) Try and guess an appropriate SqlDriver name from a JDBC URL. | protected IndexDiff | getIndexDiffForName(TableDiff tableDiff, String name, boolean db) | public HashMap | getJavaTypeMappings() Get the default field mappings for this driver. | public int | getMajorVersion() | public int | getMaxInOperands() What is the maximum number of parameters allowed for the IN (?, .. | public int | getMinorVersion() | public String | getMinorVersionPatchLevel() | abstract public String | getName() Get the name of this driver. | public static String | getNameFromURL(String url) Try and guess an appropriate SqlDriver name from a JDBC URL. | public String | getQueryPlan(Connection con, PreparedStatement ps) Get the query plan for ps and cleanup anything done in
prepareForGetQueryPlan. | public String | getRunCommand() | protected String | getSchema(Connection con) | public char[] | getSelectForUpdate() Get whatever needs to be appended to a SELECT statement to lock the
rows if this makes sense for the database. | public String | getSqlBinaryOp(int op) Get the string form of a binary operator. | public String | getSqlParamString(int jdbcType) Get a String for a replacable parameter. | public char[] | getSqlParamStringChars(int jdbcType) Return a shared char[] of the sqlParamString. | public String | getSqlUnaryFunctionName(int func) Get the name of a function that accepts one argument. | public ArrayList | getTableNames(Connection con) Get the names of all tables in the database con is connected to. | protected String | getTempColumnName(JdbcTable table) | protected String | getTempTableName(JdbcTable table, int lenght) | protected JdbcTypeMapping | getTypeMapping(int jdbcType) Get the default type mapping for the supplied JDBC type code from
java.sql.Types or null if the type is not supported. | final public JdbcTypeMapping[] | getTypeMappings() Get the default type mappings for this driver. | protected String | getTypeName(int jdbcType) Get the database specific name for the jdbcType. | public String | getVersion() | protected void | init(Driver jdbcDriver) Perform any driver specific customization. | boolean | isAddSequenceColumn(JdbcColumn addColumn) | public boolean | isAnsiJoinSyntax() Does this driver use the ANSI join syntax (i.e. | public boolean | isAutoIncSupported() | public boolean | isBatchingSupportedForJdbcType(int jdbcType) | public boolean | isClearBatchRequired() Some drivers require a call to clear the batches. | public boolean | isCommentSupported() | public boolean | isConvertExistsToDistinctJoin() Must 'exists (select ...)' clauses be converted into a join and
distinct be added to the select (e.g. | public boolean | isConvertExistsToJoins(int type) | public boolean | isCustomizeForServerRequired() Does this store do anything in
SqlDriver.customizeForServer(java.sql.Connection) . | boolean | isDirectAddColumnSupported(JdbcColumn ourCol) | boolean | isDirectDropColumnSupported() | boolean | isDirectLenghtColumnChangesSupported(JdbcColumn ourCol, JdbcColumn dbCol) | boolean | isDirectNullColumnChangesSupported() | boolean | isDirectScaleColumnChangesSupported(JdbcColumn ourCol, JdbcColumn dbCol) | boolean | isDirectTypeColumnChangesSupported(JdbcColumn ourCol, JdbcColumn dbCol) | boolean | isDropConstraintsForDropTableSupported() | boolean | isDropPrimaryKeySupported() | boolean | isDropSequenceColumn(TableDiff tableDiff, JdbcColumn dropColumn) | public boolean | isDuplicateKey(Throwable e) | public boolean | isExtraParens() | public boolean | isFetchSizeSupported() | public boolean | isHandleDuplicateKey() | public boolean | isHandleLockTimeout() | public boolean | isInsertBatchingSupported() | public boolean | isLikeStupid() Does the LIKE operator only support literal string and column
arguments (e.g. | public boolean | isLockTimeout(Throwable e) | public boolean | isNullForeignKeyOk() | public boolean | isOptimizeExistsUnderOrToOuterJoin() | public boolean | isOracleStoreProcs() | public boolean | isPreparedStatementPoolingOK() | public boolean | isPutOrderColsInSelect() | public boolean | isScrollableResultSetSupported() | public boolean | isSelectForUpdateAppendTable() | public boolean | isSelectForUpdateWithAggregateOk() | public boolean | isSelectForUpdateWithDistinctOk() | public boolean | isSetTransactionIsolationLevelSupported() | public boolean | isSubQueryJoinMayUseOuterQueryCols() May the ON clauses for joins in a subquery reference columns from the
enclosing query? DB2 does not allow this. | public boolean | isUpdateBatchingSupported() | public boolean | isUseIndexesForOrderCols() Should indexes be used for columns in the order by list that are
also in the select list? This is used for databases that will not
order by a column that is duplicated in the select list (e.g. | protected boolean | isValidSchemaTable(String tableName) | public RuntimeException | mapException(Throwable cause, String message, boolean isFatal) Maps a backend exception to a specific JDO exception
Parameters: cause - the backend exception Parameters: message - error message. | public static RuntimeException | mapException(SqlDriver sqlDriver, Throwable cause, String message) Convenience method, which gets the SqlDriver instance from the
store and calls its mapException() method. | public static RuntimeException | mapException(SqlDriver sqlDriver, Throwable cause, String message, boolean isFatal) Convenience method, which gets the SqlDriver instance from the
store and calls its mapException() method.
If no SqlDriver is set, SqlDriver.defaultMapException() is called.
Parameters: sqlDriver - Parameters: cause - the backend exception Parameters: message - error message. | protected String | pad(int i) | public String | prepareForGetQueryPlan(Connection con, String sql) Get con ready for a getQueryPlan call. | protected void | print(PrintWriter out, String sql) Write an SQL statement to a script with appropriate separator. | public boolean | putOrderColsInGroupBy() Should columns be added to groupBy in appear in orderby and not in groupBy. | protected void | reportFixes(ArrayList diffList, PrintWriter out) | public void | setAllTableAndViewNames(Connection con) Get the names of all tables in the database con is connected to. | protected String | shrinkName(String name, int maxlen) Shrink the supplied name to maxlen chars if it is longer than maxlen. | public String | toSqlLiteral(double d) Convert d to a String suitable for embedding as a literal in an SQL
statement. | public String | toSqlLiteral(long l) Convert l to a String suitable for embedding as a literal in an SQL
statement. | public String | toSqlLiteral(String s) Convert s to a String suitable for embedding as a literal in an SQL
statement. | public String | toSqlLiteral(boolean b) Convert s to a String suitable for embedding as a literal in an SQL
statement. | public void | updateClassForPostInsertKeyGen(ClassMetaData cmd, JdbcMappingResolver mappingResolver) Provide an oportunity for the driver to update the column's
used for post insert keygen. | public boolean | useColAliasForAddedCols() Should we use the col alias for columns that was added to the select
list because they are in the orderby and not in the selectList. | public boolean | useColumnIndexForGroupBy() Use the index of the column in the 'group by' expression. | protected boolean | useZeroScale(JdbcColumn c) |
COMMENT_COL | final protected static int COMMENT_COL(Code) | | |
DEFAULT_PARAM_CHARS | final public static char[] DEFAULT_PARAM_CHARS(Code) | | |
JDBC_TYPES | final public static int[] JDBC_TYPES(Code) | | These are all the JDBC type codes that we care about. All SqlDriver
subclasses must provide a mapping for each of these.
|
SqlDriver | public SqlDriver()(Code) | | |
addPrimaryKeyConstraint | protected void addPrimaryKeyConstraint(JdbcTable t, CharBuf s)(Code) | | Add the primary key constraint in isolation.
|
appendColumnNameList | protected void appendColumnNameList(JdbcColumn[] cols, CharBuf s)(Code) | | Append a comma separated list of column names to s.
|
appendColumnType | protected void appendColumnType(JdbcColumn c, CharBuf s)(Code) | | Append the column type part of a create table statement for a column.
|
appendColumnType | protected void appendColumnType(JdbcColumn c, CharBuf s, boolean useZeroScale)(Code) | | Append the column type part of a create table statement for a column.
|
appendCreateColumn | protected void appendCreateColumn(JdbcTable t, JdbcColumn c, CharBuf s, boolean comments)(Code) | | Append the part of a create table statement for a column.
|
appendCreateColumnAutoInc | protected void appendCreateColumnAutoInc(JdbcTable t, JdbcColumn c, CharBuf s)(Code) | | Append the column auto increment part of a create table statement for a
column.
|
appendCreateColumnNulls | protected void appendCreateColumnNulls(JdbcTable t, JdbcColumn c, CharBuf s)(Code) | | Append the allow nulls part of the definition for a column in a
create table statement.
|
appendCreateIndex | protected void appendCreateIndex(CharBuf s, JdbcTable t, JdbcIndex idx, boolean comments)(Code) | | Generate a 'create index' statement for idx.
|
appendIndexesInCreateTable | protected void appendIndexesInCreateTable(JdbcTable t, CharBuf s)(Code) | | Hook for drivers that must create indexes in the create table
statement (e.g. MySQL).
|
appendModifyColumn | protected void appendModifyColumn(TableDiff tableDiff, ColumnDiff diff, CharBuf s, boolean comments)(Code) | | Append a column that needs to be added.
|
appendPrimaryKeyConstraint | protected void appendPrimaryKeyConstraint(JdbcTable t, CharBuf s)(Code) | | Add the primary key constraint part of a create table statement to s.
|
appendRefDropConstraint | protected void appendRefDropConstraint(CharBuf s, JdbcConstraint c, boolean comments)(Code) | | Append an 'drop constraint' statement for c.
|
appendSqlFromJoin | public void appendSqlFromJoin(JdbcTable table, String alias, SqlExp exp, boolean outer, CharBuf s)(Code) | | Append the from list entry for a table that is the right hand table
in a join i.e. it is being joined to.
Parameters: exp - This is the expression that joins the tables Parameters: outer - If true then this is an outer join |
appendTableType | protected void appendTableType(JdbcTable t, CharBuf s)(Code) | | Hook for drivers that have to append a table type to the create table
statement (e.g. MySQL).
|
appendWhereParam | public void appendWhereParam(CharBuf s, JdbcColumn c)(Code) | | Append a replacable parameter part of a where clause for the column.
This gives the driver a chance to embed type conversions and so on
for types not handled well by the JDBC driver (e.g. BigDecimals and
the postgres JDBC driver).
|
createJdbcDriver | public static Driver createJdbcDriver(String name, ClassLoader cl)(Code) | | Load a JDBC driver class and create an instance of it. The driver
class is unregistered if possible.
|
createJdbcNameGenerator | public JdbcNameGenerator createJdbcNameGenerator()(Code) | | Create a default name generator instance for JdbcStore's using this
driver.
|
createSqlDriver | public static SqlDriver createSqlDriver(String name, Driver jdbcDriver)(Code) | | Create a SqlDriver instance by name.
Parameters: jdbcDriver - Optional JDBC driver for more accurate feature use throws: javax.jdo.JDOFatalUserException - if name is invalid See Also: SqlDriver.customizeForServer |
customizeForServer | public void customizeForServer(Connection con) throws SQLException(Code) | | Perform any specific configuration appropriate for the database server
in use. If any SQL is done on con call con.commit() before returning.
|
defaultMapException | public static RuntimeException defaultMapException(Throwable cause, String message, boolean isFatal)(Code) | | Maps a backend exception to a specific JDO exception.
This is the default implementation which is used if no SqlDriver
instance is available.
Parameters: cause - the backend exception Parameters: message - error message. if null, the error message istaken from the backend exception Parameters: isFatal - is the error fatal or not |
dropPrimaryKeyConstraint | protected void dropPrimaryKeyConstraint(JdbcTable t, CharBuf s)(Code) | | Drop the primary key constraint in isolation.
|
dropTable | public void dropTable(Connection con, String table) throws SQLException(Code) | | Drop the table and all its constraints etc. This must remove
constraints to this table from other tables so it can be dropped.
|
dropTable | protected void dropTable(Connection con, String table, Statement stat) throws SQLException(Code) | | Drop the table and all its constraints etc. This must remove
constraints to this table from other tables so it can be dropped.
|
enableIdentityInsert | public void enableIdentityInsert(Connection con, String table, boolean on) throws SQLException(Code) | | Enable or disable identity insert for the given table if this is
required to insert a value into an identity column.
|
fillDatabaseMetaData | public void fillDatabaseMetaData(ArrayList tables, HashMap dbMap)(Code) | | Fill the db classes with mapping info
|
fixAllNames | public void fixAllNames(HashMap nameMap)(Code) | | Fixes all the names with spaces in
Parameters: nameMap - |
fixConstraintsForNonDirectColumns | protected void fixConstraintsForNonDirectColumns(TableDiff tableDiff, PrintWriter out, boolean drop)(Code) | | |
generateDDL | public void generateDDL(ArrayList tables, Connection con, PrintWriter out, boolean comments)(Code) | | Generate SQL to create the database schema for the supplied tables.
If con is not null then it must have autoCommit true.
|
getAggregateTypeCode | public int getAggregateTypeCode(int aggType, int currentTypeCode)(Code) | | Calculate the typeCode for a aggregate expression.
Parameters: aggType - The aggregate type. Parameters: currentTypeCode - The currenct calculated typeCode. See Also: MDStatics |
getColumnDiffForName | protected ColumnDiff getColumnDiffForName(TableDiff tableDiff, String name)(Code) | | Gets the Column diff for the column name, else returns null
|
getConnectionInitSQL | public String getConnectionInitSQL()(Code) | | Get default SQL used to init a connection or null if none required.
|
getConnectionValidateSQL | public String getConnectionValidateSQL()(Code) | | Get default SQL to test a connection or null if none available. This
must be a query that returns at least one row.
|
getConstraintDiffForName | protected ConstraintDiff getConstraintDiffForName(TableDiff tableDiff, String name, boolean db)(Code) | | Gets the Constraint diff for the constraint name, else returns null
|
getDatabaseMetaData | public HashMap getDatabaseMetaData(ArrayList tables, Connection con) throws SQLException(Code) | | Get all the database tables and columns that is not system tables
and that is filled with what field it belongs to.
|
getDefaultPsCacheMax | public int getDefaultPsCacheMax()(Code) | | How many PreparedStatement's should the pool be limited to by default
(0 for unlimited) ?
|
getDefaultValueComment | protected String getDefaultValueComment()(Code) | | |
getDriverFromURL | public static String getDriverFromURL(String url)(Code) | | Try and guess an appropriate SqlDriver name from a JDBC URL. Returns
null if no match.
|
getIndexDiffForName | protected IndexDiff getIndexDiffForName(TableDiff tableDiff, String name, boolean db)(Code) | | Gets the Index diff for the index name, else returns null
|
getJavaTypeMappings | public HashMap getJavaTypeMappings()(Code) | | Get the default field mappings for this driver. These map java classes
to column properties. Subclasses should override this, call super() and
replace mappings as needed.
|
getMajorVersion | public int getMajorVersion()(Code) | | |
getMaxInOperands | public int getMaxInOperands()(Code) | | What is the maximum number of parameters allowed for the IN (?, .. ?)
operator?
|
getMinorVersion | public int getMinorVersion()(Code) | | |
getMinorVersionPatchLevel | public String getMinorVersionPatchLevel()(Code) | | |
getName | abstract public String getName()(Code) | | Get the name of this driver.
|
getNameFromURL | public static String getNameFromURL(String url)(Code) | | Try and guess an appropriate SqlDriver name from a JDBC URL. Returns
null if no match.
|
getSelectForUpdate | public char[] getSelectForUpdate()(Code) | | Get whatever needs to be appended to a SELECT statement to lock the
rows if this makes sense for the database. This must have a leading
space if not empty.
|
getSqlBinaryOp | public String getSqlBinaryOp(int op)(Code) | | Get the string form of a binary operator.
See Also: BinaryOpExp |
getSqlParamString | public String getSqlParamString(int jdbcType)(Code) | | Get a String for a replacable parameter. This gives the driver a
chance to embed type conversions and so on for types not handled well
by the JDBC driver (e.g. BigDecimals and the postgres JDBC driver).
If you override this method then you must also override
SqlDriver.getSqlParamStringChars(int) .
|
getSqlParamStringChars | public char[] getSqlParamStringChars(int jdbcType)(Code) | | Return a shared char[] of the sqlParamString. This array may not be modified.
It is used as a stamp when creating a in list.
Parameters: jdbcType - |
getSqlUnaryFunctionName | public String getSqlUnaryFunctionName(int func)(Code) | | Get the name of a function that accepts one argument.
See Also: UnaryFunctionExp |
getTypeMapping | protected JdbcTypeMapping getTypeMapping(int jdbcType)(Code) | | Get the default type mapping for the supplied JDBC type code from
java.sql.Types or null if the type is not supported. There is no
need to set the database or jdbcType on the mapping as this is done
after this call returns. Subclasses should override this and to
customize type mappings.
|
getTypeName | protected String getTypeName(int jdbcType)(Code) | | Get the database specific name for the jdbcType.
See Also: Types |
init | protected void init(Driver jdbcDriver)(Code) | | Perform any driver specific customization. This can be used to control
functionality depending on the version of JDBC driver in use etc.
|
isAddSequenceColumn | boolean isAddSequenceColumn(JdbcColumn addColumn)(Code) | | Parameters: addColumn - |
isAnsiJoinSyntax | public boolean isAnsiJoinSyntax()(Code) | | Does this driver use the ANSI join syntax (i.e. the join clauses appear
in the from list e.g. postgres)?
|
isAutoIncSupported | public boolean isAutoIncSupported()(Code) | | Does this database support autoincrement or serial columns?
|
isBatchingSupportedForJdbcType | public boolean isBatchingSupportedForJdbcType(int jdbcType)(Code) | | Can batching be used if the statement contains a column with the
given JDBC type?
|
isClearBatchRequired | public boolean isClearBatchRequired()(Code) | | Some drivers require a call to clear the batches.
|
isCommentSupported | public boolean isCommentSupported()(Code) | | Does this database support comments embedded in SQL?
|
isConvertExistsToDistinctJoin | public boolean isConvertExistsToDistinctJoin()(Code) | | Must 'exists (select ...)' clauses be converted into a join and
distinct be added to the select (e.g. MySQL) ?
|
isConvertExistsToJoins | public boolean isConvertExistsToJoins(int type)(Code) | | |
isDirectAddColumnSupported | boolean isDirectAddColumnSupported(JdbcColumn ourCol)(Code) | | |
isDirectDropColumnSupported | boolean isDirectDropColumnSupported()(Code) | | |
isDirectNullColumnChangesSupported | boolean isDirectNullColumnChangesSupported()(Code) | | |
isDropConstraintsForDropTableSupported | boolean isDropConstraintsForDropTableSupported()(Code) | | |
isDropPrimaryKeySupported | boolean isDropPrimaryKeySupported()(Code) | | |
isDropSequenceColumn | boolean isDropSequenceColumn(TableDiff tableDiff, JdbcColumn dropColumn)(Code) | | Is this a sequence column from a List implementation that we are dropping to create a Set?
|
isDuplicateKey | public boolean isDuplicateKey(Throwable e)(Code) | | Is this a duplicate key exception?
|
isExtraParens | public boolean isExtraParens()(Code) | | Must some expressions (+, -, string concat) be wrapped in brackets?
|
isFetchSizeSupported | public boolean isFetchSizeSupported()(Code) | | Does the JDBC driver support Statement.setFetchSize()?
|
isHandleDuplicateKey | public boolean isHandleDuplicateKey()(Code) | | Does the driver detect and handle exceptions caused by
duplicate primary keys?
|
isHandleLockTimeout | public boolean isHandleLockTimeout()(Code) | | Does the driver detect and handle exceptions caused by
lock timeouts?
|
isInsertBatchingSupported | public boolean isInsertBatchingSupported()(Code) | | Does the JDBC driver support statement batching for inserts?
|
isLikeStupid | public boolean isLikeStupid()(Code) | | Does the LIKE operator only support literal string and column
arguments (e.g. Informix)?
|
isLockTimeout | public boolean isLockTimeout(Throwable e)(Code) | | Is this a lock timeout exception?
|
isNullForeignKeyOk | public boolean isNullForeignKeyOk()(Code) | | Is null a valid value for a column with a foreign key constraint?
|
isOptimizeExistsUnderOrToOuterJoin | public boolean isOptimizeExistsUnderOrToOuterJoin()(Code) | | Is it ok to convert simple 'exists (select ...)' clauses under an
'or' into outer joins?
|
isOracleStoreProcs | public boolean isOracleStoreProcs()(Code) | | |
isPreparedStatementPoolingOK | public boolean isPreparedStatementPoolingOK()(Code) | | Should PreparedStatement batching be used for this database and
JDBC driver?
|
isPutOrderColsInSelect | public boolean isPutOrderColsInSelect()(Code) | | Must columns used in an order by statement appear in the select list?
|
isScrollableResultSetSupported | public boolean isScrollableResultSetSupported()(Code) | | Does the JDBC driver support scrollable result sets?
|
isSelectForUpdateAppendTable | public boolean isSelectForUpdateAppendTable()(Code) | | Does 'SELECT FOR UPDATE' require the main table of the query to be
appended (ala postgres)?
|
isSelectForUpdateWithAggregateOk | public boolean isSelectForUpdateWithAggregateOk()(Code) | | |
isSelectForUpdateWithDistinctOk | public boolean isSelectForUpdateWithDistinctOk()(Code) | | Can 'SELECT FOR UPDATE' be used with a DISTINCT?
|
isSetTransactionIsolationLevelSupported | public boolean isSetTransactionIsolationLevelSupported()(Code) | | Can the tx isolation level be set on this database?
|
isSubQueryJoinMayUseOuterQueryCols | public boolean isSubQueryJoinMayUseOuterQueryCols()(Code) | | May the ON clauses for joins in a subquery reference columns from the
enclosing query? DB2 does not allow this.
|
isUpdateBatchingSupported | public boolean isUpdateBatchingSupported()(Code) | | Does the JDBC driver support statement batching for updates?
|
isUseIndexesForOrderCols | public boolean isUseIndexesForOrderCols()(Code) | | Should indexes be used for columns in the order by list that are
also in the select list? This is used for databases that will not
order by a column that is duplicated in the select list (e.g. Oracle).
|
isValidSchemaTable | protected boolean isValidSchemaTable(String tableName)(Code) | | |
mapException | public RuntimeException mapException(Throwable cause, String message, boolean isFatal)(Code) | | Maps a backend exception to a specific JDO exception
Parameters: cause - the backend exception Parameters: message - error message. if null, the error message istaken from the backend exception Parameters: isFatal - is the error fatal or not |
mapException | public static RuntimeException mapException(SqlDriver sqlDriver, Throwable cause, String message)(Code) | | Convenience method, which gets the SqlDriver instance from the
store and calls its mapException() method. isFatal defaults to true.
If no SqlDriver is set, SqlDriver.defaultMapException() is called.
Parameters: sqlDriver - Parameters: cause - the backend exception Parameters: message - error message. if null, the error message is |
mapException | public static RuntimeException mapException(SqlDriver sqlDriver, Throwable cause, String message, boolean isFatal)(Code) | | Convenience method, which gets the SqlDriver instance from the
store and calls its mapException() method.
If no SqlDriver is set, SqlDriver.defaultMapException() is called.
Parameters: sqlDriver - Parameters: cause - the backend exception Parameters: message - error message. if null, the error message istaken from the backend exception Parameters: isFatal - is the error fatal or not |
pad | protected String pad(int i)(Code) | | Get a string back with lengh i
|
prepareForGetQueryPlan | public String prepareForGetQueryPlan(Connection con, String sql)(Code) | | Get con ready for a getQueryPlan call. Example: On Sybase this will
do a 'set showplan 1' and 'set noexec 1'. Also make whatever changes
are necessary to sql to prepare it for a getQueryPlan call. Example:
On Oracle this will prepend 'explain '. The cleanupForGetQueryPlan
method must be called in a finally block if this method is called.
See Also: SqlDriver.cleanupForGetQueryPlan See Also: SqlDriver.getQueryPlan |
print | protected void print(PrintWriter out, String sql)(Code) | | Write an SQL statement to a script with appropriate separator.
|
putOrderColsInGroupBy | public boolean putOrderColsInGroupBy()(Code) | | Should columns be added to groupBy in appear in orderby and not in groupBy.
|
setAllTableAndViewNames | public void setAllTableAndViewNames(Connection con) throws SQLException(Code) | | Get the names of all tables in the database con is connected to.
|
shrinkName | protected String shrinkName(String name, int maxlen)(Code) | | Shrink the supplied name to maxlen chars if it is longer than maxlen.
This implementation removes vowels first and then truncates if it has
to.
|
toSqlLiteral | public String toSqlLiteral(double d)(Code) | | Convert d to a String suitable for embedding as a literal in an SQL
statement.
|
toSqlLiteral | public String toSqlLiteral(long l)(Code) | | Convert l to a String suitable for embedding as a literal in an SQL
statement.
|
toSqlLiteral | public String toSqlLiteral(String s)(Code) | | Convert s to a String suitable for embedding as a literal in an SQL
statement.
|
toSqlLiteral | public String toSqlLiteral(boolean b)(Code) | | Convert s to a String suitable for embedding as a literal in an SQL
statement.
|
updateClassForPostInsertKeyGen | public void updateClassForPostInsertKeyGen(ClassMetaData cmd, JdbcMappingResolver mappingResolver)(Code) | | Provide an oportunity for the driver to update the column's
used for post insert keygen.
|
useColAliasForAddedCols | public boolean useColAliasForAddedCols()(Code) | | Should we use the col alias for columns that was added to the select
list because they are in the orderby and not in the selectList.
|
useColumnIndexForGroupBy | public boolean useColumnIndexForGroupBy()(Code) | | Use the index of the column in the 'group by' expression.
|
|
|