Package org.frankframework.dbms
Interface IDbmsSupport
- All Known Implementing Classes:
Db2DbmsSupport
,GenericDbmsSupport
,H2DbmsSupport
,MariaDbDbmsSupport
,MsSqlServerDbmsSupport
,MySqlDbmsSupport
,OracleDbmsSupport
,PostgresqlDbmsSupport
public interface IDbmsSupport
Interface to define DBMS specific SQL implementations.
- Since:
- Author:
- Gerrit van Brakel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyBlobParameter
(PreparedStatement stmt, int column, Object blobInsertHandle) void
applyClobParameter
(PreparedStatement stmt, int column, Object clobHandle) autoIncrementInsertValue
(String sequenceName) boolean
boolean
default boolean
convertQuery
(String query, String sqlDialectFrom) getBlobHandle
(PreparedStatement stmt, int column) getBlobHandle
(ResultSet rs, int column) getBlobInputStream
(ResultSet rs, int column) getBlobInputStream
(ResultSet rs, String column) getBlobOutputStream
(PreparedStatement stmt, int column, Object blobInsertHandle) getBlobOutputStream
(ResultSet rs, int column, Object blobHandle) getBooleanValue
(boolean value) getClobHandle
(PreparedStatement stmt, int column) getClobHandle
(ResultSet rs, int column) getClobReader
(ResultSet rs, int column) getClobReader
(ResultSet rs, String column) getClobWriter
(PreparedStatement stmt, int column, Object clobHandle) getClobWriter
(ResultSet rs, int column, Object clobHandle) default SQLType
getDateAndOffset
(String dateValue, int daysOffset) getDatetimeLiteral
(Date date) getDbms()
http://en.wikipedia.org/wiki/DUAL_tablegetSchema
(Connection conn) SQL String returning current date and time of dbms.getTableColumns
(Connection conn, String tableName) getTableColumns
(Connection conn, String schemaName, String tableName) getTableColumns
(Connection conn, String schemaName, String tableName, String columnNamePattern) getTimestampAsDate
(String columnName) boolean
hasIndexOnColumn
(Connection conn, String schemaOwner, String tableName, String columnName) boolean
hasIndexOnColumns
(Connection conn, String schemaOwner, String tableName, List<String> columns) boolean
boolean
isBlobType
(ResultSetMetaData rsmeta, int colNum) boolean
isClobType
(ResultSetMetaData rsmeta, int colNum) boolean
isColumnPresent
(Connection conn, String tableName, String columnName) boolean
isColumnPresent
(Connection conn, String schemaName, String tableName, String columnName) boolean
boolean
default boolean
isRowVersionTimestamp
(ResultSetMetaData resultSetMetaData, int columnNumber) boolean
isSequencePresent
(Connection conn, String schemaOwner, String tableName, String sequenceName) default boolean
DBMS Feature flag: is it possible to call a stored procedure that returns the results of a SELECT statement directly, without needing a REFCURSOR OUT parameter.boolean
isTablePresent
(Connection conn, String tableName) boolean
isTablePresent
(Connection conn, String schemaName, String tableName) prepareQueryTextForNonLockingRead
(String selectQuery) Modify the provided selectQuery in such a way that the resulting query will not be blocked by locks, and will avoid placing locks itself as much as possible.prepareQueryTextForWorkQueuePeeking
(int batchSize, String selectQuery) prepareQueryTextForWorkQueuePeeking
(int batchSize, String selectQuery, int wait) prepareQueryTextForWorkQueueReading
(int batchSize, String selectQuery) prepareQueryTextForWorkQueueReading
(int batchSize, String selectQuery, int wait) provideFirstRowsHintAfterFirstKeyword
(int rowCount) provideIndexHintAfterFirstKeyword
(String tableName, String indexName) provideTrailingFirstRowsHint
(int rowCount) void
updateBlob
(ResultSet rs, int column, Object blobHandle) void
updateBlob
(ResultSet rs, String column, Object blobHandle) void
updateClob
(ResultSet rs, int column, Object clobHandle) void
updateClob
(ResultSet rs, String column, Object clobHandle)
-
Method Details
-
getDbms
Dbms getDbms() -
getDbmsName
String getDbmsName() -
isParameterTypeMatchRequired
boolean isParameterTypeMatchRequired() -
hasSkipLockedFunctionality
boolean hasSkipLockedFunctionality() -
getSysDate
String getSysDate()SQL String returning current date and time of dbms. -
getDateAndOffset
-
getFromForTablelessSelect
String getFromForTablelessSelect()http://en.wikipedia.org/wiki/DUAL_table -
getAutoIncrementKeyFieldType
String getAutoIncrementKeyFieldType() -
autoIncrementKeyMustBeInserted
boolean autoIncrementKeyMustBeInserted() -
autoIncrementInsertValue
-
autoIncrementUsesSequenceObject
boolean autoIncrementUsesSequenceObject() -
getTimestampFieldType
String getTimestampFieldType() -
getDatetimeLiteral
-
getTimestampAsDate
-
isClobType
- Throws:
SQLException
-
getClobReader
- Throws:
SQLException
DbmsException
-
getClobReader
- Throws:
SQLException
DbmsException
-
getClobHandle
- Throws:
SQLException
DbmsException
-
getClobWriter
Writer getClobWriter(ResultSet rs, int column, Object clobHandle) throws SQLException, DbmsException - Throws:
SQLException
DbmsException
-
updateClob
- Throws:
SQLException
DbmsException
-
updateClob
- Throws:
SQLException
DbmsException
-
getClobHandle
- Throws:
SQLException
DbmsException
-
getClobWriter
Writer getClobWriter(PreparedStatement stmt, int column, Object clobHandle) throws SQLException, DbmsException - Throws:
SQLException
DbmsException
-
applyClobParameter
void applyClobParameter(PreparedStatement stmt, int column, Object clobHandle) throws SQLException, DbmsException - Throws:
SQLException
DbmsException
-
getBlobFieldType
String getBlobFieldType() -
isBlobType
- Throws:
SQLException
-
getBlobInputStream
- Throws:
SQLException
DbmsException
-
getBlobInputStream
- Throws:
SQLException
DbmsException
-
getBlobHandle
- Throws:
SQLException
DbmsException
-
getBlobOutputStream
OutputStream getBlobOutputStream(ResultSet rs, int column, Object blobHandle) throws SQLException, DbmsException - Throws:
SQLException
DbmsException
-
updateBlob
- Throws:
SQLException
DbmsException
-
updateBlob
- Throws:
SQLException
DbmsException
-
getBlobHandle
- Throws:
SQLException
DbmsException
-
getBlobOutputStream
OutputStream getBlobOutputStream(PreparedStatement stmt, int column, Object blobInsertHandle) throws SQLException, DbmsException - Throws:
SQLException
DbmsException
-
applyBlobParameter
void applyBlobParameter(PreparedStatement stmt, int column, Object blobInsertHandle) throws SQLException, DbmsException - Throws:
SQLException
DbmsException
-
getTextFieldType
String getTextFieldType() -
prepareQueryTextForWorkQueueReading
- Throws:
DbmsException
-
prepareQueryTextForWorkQueueReading
String prepareQueryTextForWorkQueueReading(int batchSize, String selectQuery, int wait) throws DbmsException - Throws:
DbmsException
-
prepareQueryTextForWorkQueuePeeking
- Throws:
DbmsException
-
prepareQueryTextForWorkQueuePeeking
String prepareQueryTextForWorkQueuePeeking(int batchSize, String selectQuery, int wait) throws DbmsException - Throws:
DbmsException
-
prepareQueryTextForNonLockingRead
Modify the provided selectQuery in such a way that the resulting query will not be blocked by locks, and will avoid placing locks itself as much as possible. Preferably, the effective isolation level is READ_COMMITTED (committed rows of other transactions may be read), but if placing locks can be avoided by an isolation level similar to READ_UNCOMMITTED, that is allowed too. Should return the query unmodified if no special action is required. For an example, seeMsSqlServerDbmsSupport.prepareQueryTextForNonLockingRead(String)
- Throws:
DbmsException
-
provideIndexHintAfterFirstKeyword
-
provideFirstRowsHintAfterFirstKeyword
-
provideTrailingFirstRowsHint
-
getSchema
- Throws:
DbmsException
-
convertQuery
@Nonnull String convertQuery(@Nonnull String query, @Nonnull String sqlDialectFrom) throws SQLException, DbmsException - Throws:
SQLException
DbmsException
-
getTableColumns
- Throws:
DbmsException
-
getTableColumns
ResultSet getTableColumns(Connection conn, String schemaName, String tableName) throws DbmsException - Throws:
DbmsException
-
getTableColumns
ResultSet getTableColumns(Connection conn, String schemaName, String tableName, String columnNamePattern) throws DbmsException - Throws:
DbmsException
-
isTablePresent
- Throws:
DbmsException
-
isTablePresent
- Throws:
DbmsException
-
isColumnPresent
- Throws:
DbmsException
-
isColumnPresent
boolean isColumnPresent(Connection conn, String schemaName, String tableName, String columnName) throws DbmsException - Throws:
DbmsException
-
isSequencePresent
boolean isSequencePresent(Connection conn, String schemaOwner, String tableName, String sequenceName) -
hasIndexOnColumn
boolean hasIndexOnColumn(Connection conn, String schemaOwner, String tableName, String columnName) throws DbmsException - Throws:
DbmsException
-
hasIndexOnColumns
boolean hasIndexOnColumns(Connection conn, String schemaOwner, String tableName, List<String> columns) throws DbmsException - Throws:
DbmsException
-
isConstraintViolation
-
getLength
-
getBooleanValue
-
isStoredProcedureResultSetSupported
default boolean isStoredProcedureResultSetSupported()DBMS Feature flag: is it possible to call a stored procedure that returns the results of a SELECT statement directly, without needing a REFCURSOR OUT parameter.- Returns:
- true for database that can directly return SELECT results. Not supported for PostgreSQL and Oracle.
-
getCursorSqlType
-
canFetchStatementParameterMetaData
default boolean canFetchStatementParameterMetaData() -
isRowVersionTimestamp
default boolean isRowVersionTimestamp(ResultSetMetaData resultSetMetaData, int columnNumber) throws SQLException - Parameters:
resultSetMetaData
-columnNumber
-- Returns:
- whether the columnNumber metadata is defined as a RowVersion/Timestamp (MSSQL - specific, see
MsSqlServerDbmsSupport
). - Throws:
SQLException
-