public abstract class OracleDatabaseType extends DatabaseType
| Modifier and Type | Field and Description |
|---|---|
static String |
VENDOR
The vendor name for all Oracle databases.
|
| Constructor and Description |
|---|
OracleDatabaseType() |
| Modifier and Type | Method and Description |
|---|---|
void |
alterColumn(Connection conn,
String table,
String column,
String generic_column_type,
String default_value,
String precision,
Boolean nullable,
Boolean reindex)
Alters an existing column.
|
String |
getBooleanValue(boolean bool)
Oracle needs 1 for true and 0 for false.
|
Integer |
getInteger(Object number)
Get the Integer representation of the number type supplied by the db vendor for an integer field value.
|
String |
getLimitClause(int limit)
Return vendor-specific row limit clause to be appended to a native SQL SELECT statement.
|
Long |
getLong(Object number)
Get the Long representation of the number type supplied by the db vendor for a long field value.
|
int |
getNextSequenceValue(Connection conn,
String table,
String key)
A utility that returns the next value of a sequence.
|
String |
getSequenceInsertValue(Connection conn,
String sequenceName)
A utility that returns the string for sequence use in an Insert statement
|
int |
getSequenceValue(Connection conn,
String table,
String key)
A utility that returns the last value of a sequence.
|
String |
getString(String varchar,
int maxLength)
Different vendors have different rules regarding varchar/varchar2 string storage.
|
String |
getVendor()
Returns
VENDOR. |
boolean |
isTableNotFoundException(SQLException e)
Determines if the given SQL exception was caused by a "table not found" error.
|
void |
reindexTable(Connection conn,
String table)
Reindexes the given table.
|
void |
setBooleanValue(boolean bool,
PreparedStatement ps,
int idx)
For Oracle databases, the boolean parameter will actually be of type "int" with a value of 0 or 1.
|
addColumn, checkColumnExists, checkTableExists, closeConnection, closeJDBCObjects, closeResultSet, closeStatement, countRows, createSequence, deleteColumn, dropSequence, dropTable, executeSelectSql, executeSql, executeSql, getDBTypeFromGenericType, getEscapeCharacter, getHibernateDialect, getName, getVersion, insert, matches, supportsSelfReferringCascade, toString, update, updateColumnpublic static final String VENDOR
public String getVendor()
VENDOR.getVendor in class DatabaseTypeDatabaseType.getVendor()public String getBooleanValue(boolean bool)
getBooleanValue in class DatabaseTypebool - the boolean value to be converted to the DB string version of the booleanDatabaseType.getBooleanValue(boolean)public Integer getInteger(Object number)
DatabaseTypegetInteger in class DatabaseTypepublic Long getLong(Object number)
DatabaseTypegetLong in class DatabaseTypepublic String getString(String varchar, int maxLength)
DatabaseTypegetString in class DatabaseTypevarchar - The String to be stored as a varchar/varchar2maxLength - max length of the DB field, in characters.public void setBooleanValue(boolean bool,
PreparedStatement ps,
int idx)
throws SQLException
setBooleanValue in class DatabaseTypebool - the boolean you wantps - the prepapred statement where the boolean will be storedidx - the index that corresponds to the boolean parameter in the statementSQLExceptionDatabaseType.setBooleanValue(boolean, PreparedStatement, int)public boolean isTableNotFoundException(SQLException e)
DatabaseTypeisTableNotFoundException in class DatabaseTypee - the SQL exception that occurredtrue if the given exception is the database's "table not found" exception.DatabaseType.isTableNotFoundException(SQLException)public int getSequenceValue(Connection conn, String table, String key) throws SQLException
DatabaseTypegetSequenceValue in class DatabaseTypeconn - The connection to use to get the sequence value.table - The table where the sequence is defined.key - The column on which the sequence is defined.SQLExceptionDatabaseType.getSequenceValue(Connection, String, String)public String getSequenceInsertValue(Connection conn, String sequenceName)
DatabaseTypegetSequenceInsertValue in class DatabaseTypeconn - The connection to use to get the sequence value.sequenceName - The sequence name for the table.public int getNextSequenceValue(Connection conn, String table, String key) throws SQLException
DatabaseTypegetNextSequenceValue in class DatabaseTypeconn - The connection to use to get the sequence value.table - The table where the sequence is defined.key - The column on which the sequence is defined.SQLExceptionDatabaseType.getNextSequenceValue(Connection, String, String)public void alterColumn(Connection conn, String table, String column, String generic_column_type, String default_value, String precision, Boolean nullable, Boolean reindex) throws SQLException
DatabaseTypealterColumn in class DatabaseTypeconn - connection to the databasetable - the name of the table where the column existscolumn - the name of the column to altergeneric_column_type - the new generic type of the columndefault_value - the new default valueprecision - the new precision of the columnnullable - the new nullable value (if true, it's value can now be NULL)reindex - if true, and the DB supports it, the table will be reindexedSQLExceptionDatabaseType.alterColumn(Connection, String, String, String, String, String, Boolean, Boolean)public void reindexTable(Connection conn, String table) throws SQLException
DatabaseTypereindexTable in class DatabaseTypeSQLExceptionDatabaseType.reindexTable(Connection, String)public String getLimitClause(int limit)
DatabaseTypegetLimitClause in class DatabaseTypeCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.