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 TypeMethodDescriptionvoidapplyBlobParameter(PreparedStatement stmt, int column, Object blobInsertHandle) voidapplyClobParameter(PreparedStatement stmt, int column, Object clobHandle) autoIncrementInsertValue(String sequenceName) booleanbooleandefault booleanconvertQuery(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 SQLTypegetDateAndOffset(String dateValue, int daysOffset) getDatetimeLiteral(Date date) getDbms()default Stringhttp://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) booleanhasIndexOnColumn(Connection conn, String schemaOwner, String tableName, String columnName) booleanhasIndexOnColumns(Connection conn, String schemaOwner, String tableName, List<String> columns) booleanbooleanisBlobType(ResultSetMetaData rsmeta, int colNum) booleanisClobType(ResultSetMetaData rsmeta, int colNum) booleanisColumnPresent(Connection conn, String tableName, String columnName) booleanisColumnPresent(Connection conn, String schemaName, String tableName, String columnName) booleanbooleandefault booleanisRowVersionTimestamp(ResultSetMetaData resultSetMetaData, int columnNumber) booleanisSequencePresent(Connection conn, String schemaOwner, String tableName, String sequenceName) default booleanDBMS 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.booleanisTablePresent(Connection conn, String tableName) booleanisTablePresent(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) voidupdateBlob(ResultSet rs, int column, Object blobHandle) voidupdateBlob(ResultSet rs, String column, Object blobHandle) voidupdateClob(ResultSet rs, int column, Object clobHandle) voidupdateClob(ResultSet rs, String column, Object clobHandle)
-
Method Details
-
getDbms
Dbms getDbms() -
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:
SQLExceptionDbmsException
-
getClobReader
- Throws:
SQLExceptionDbmsException
-
getClobHandle
- Throws:
SQLExceptionDbmsException
-
getClobWriter
Writer getClobWriter(ResultSet rs, int column, Object clobHandle) throws SQLException, DbmsException - Throws:
SQLExceptionDbmsException
-
updateClob
- Throws:
SQLExceptionDbmsException
-
updateClob
- Throws:
SQLExceptionDbmsException
-
getClobHandle
- Throws:
SQLExceptionDbmsException
-
getClobWriter
Writer getClobWriter(PreparedStatement stmt, int column, Object clobHandle) throws SQLException, DbmsException - Throws:
SQLExceptionDbmsException
-
applyClobParameter
void applyClobParameter(PreparedStatement stmt, int column, Object clobHandle) throws SQLException, DbmsException - Throws:
SQLExceptionDbmsException
-
getBlobFieldType
String getBlobFieldType() -
isBlobType
- Throws:
SQLException
-
getBlobInputStream
- Throws:
SQLExceptionDbmsException
-
getBlobInputStream
- Throws:
SQLExceptionDbmsException
-
getBlobHandle
- Throws:
SQLExceptionDbmsException
-
getBlobOutputStream
OutputStream getBlobOutputStream(ResultSet rs, int column, Object blobHandle) throws SQLException, DbmsException - Throws:
SQLExceptionDbmsException
-
updateBlob
- Throws:
SQLExceptionDbmsException
-
updateBlob
- Throws:
SQLExceptionDbmsException
-
getBlobHandle
- Throws:
SQLExceptionDbmsException
-
getBlobOutputStream
OutputStream getBlobOutputStream(PreparedStatement stmt, int column, Object blobInsertHandle) throws SQLException, DbmsException - Throws:
SQLExceptionDbmsException
-
applyBlobParameter
void applyBlobParameter(PreparedStatement stmt, int column, Object blobInsertHandle) throws SQLException, DbmsException - Throws:
SQLExceptionDbmsException
-
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:
SQLExceptionDbmsException
-
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
-