Interface FirebirdConnection
-
- All Superinterfaces:
java.lang.AutoCloseable,java.sql.Connection,java.sql.Wrapper
- All Known Implementing Classes:
FBConnection
public interface FirebirdConnection extends java.sql.ConnectionExtension ofConnectioninterface providing access to Firebird specific features.- Author:
- Roman Rokytskyy
-
-
Field Summary
Fields Modifier and Type Field Description static intTPB_CONCURRENCYDeprecated.static intTPB_CONSISTENCYDeprecated.static intTPB_NO_REC_VERSIONDeprecated.static intTPB_NOWAITDeprecated.static intTPB_READDeprecated.static intTPB_READ_COMMITTEDDeprecated.static intTPB_REC_VERSIONDeprecated.static intTPB_WAITDeprecated.static intTPB_WRITEDeprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.sql.BlobcreateBlob()TransactionParameterBuffercreateTransactionParameterBuffer()Create new instance ofTransactionParameterBuffer.java.lang.StringenquoteIdentifier(java.lang.String identifier, boolean alwaysDelimit)Returns a simple SQL identifier or a delimited identifier, as appropriate for the connection dialect.java.lang.StringenquoteLiteral(java.lang.String val)Returns a string appropriately quoted as a string literal for the connection dialect.java.lang.StringenquoteNCharLiteral(java.lang.String val)Returns a string appropriately quoted as a string literal for the connection dialect.FbDatabasegetFbDatabase()Provides access to the low-level connection handle.java.lang.StringgetIscEncoding()Deprecated.Will be removed in Jaybird 6TransactionParameterBuffergetTransactionParameters(int isolationLevel)Get transaction parameters for the specified transaction isolation level.booleanisSimpleIdentifier(java.lang.String identifier)Returns whetheridentifieris a simple identifier.booleanisUseFirebirdAutoCommit()voidsetTransactionParameters(int isolationLevel, int[] parameters)Deprecated.voidsetTransactionParameters(int isolationLevel, TransactionParameterBuffer tpb)Set transaction parameters for the specified transaction isolation level.voidsetTransactionParameters(TransactionParameterBuffer tpb)Set transaction parameters for the next transactions.-
Methods inherited from interface java.sql.Connection
abort, beginRequest, clearWarnings, close, commit, createArrayOf, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, endRequest, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation, setTypeMap
-
-
-
-
Field Detail
-
TPB_READ_COMMITTED
@Deprecated static final int TPB_READ_COMMITTED
Deprecated.- See Also:
- Constant Field Values
-
TPB_CONCURRENCY
@Deprecated static final int TPB_CONCURRENCY
Deprecated.- See Also:
- Constant Field Values
-
TPB_CONSISTENCY
@Deprecated static final int TPB_CONSISTENCY
Deprecated.- See Also:
- Constant Field Values
-
TPB_READ
@Deprecated static final int TPB_READ
Deprecated.- See Also:
- Constant Field Values
-
TPB_WRITE
@Deprecated static final int TPB_WRITE
Deprecated.- See Also:
- Constant Field Values
-
TPB_WAIT
@Deprecated static final int TPB_WAIT
Deprecated.- See Also:
- Constant Field Values
-
TPB_NOWAIT
@Deprecated static final int TPB_NOWAIT
Deprecated.- See Also:
- Constant Field Values
-
TPB_REC_VERSION
@Deprecated static final int TPB_REC_VERSION
Deprecated.- See Also:
- Constant Field Values
-
TPB_NO_REC_VERSION
@Deprecated static final int TPB_NO_REC_VERSION
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
createBlob
java.sql.Blob createBlob() throws java.sql.SQLException- Specified by:
createBlobin interfacejava.sql.Connection- Returns:
- instance of
FirebirdBlob. - Throws:
java.sql.SQLException
-
getIscEncoding
@Deprecated java.lang.String getIscEncoding() throws java.sql.SQLExceptionDeprecated.Will be removed in Jaybird 6Get current ISC encoding.- Returns:
- current ISC encoding.
- Throws:
java.sql.SQLException
-
setTransactionParameters
@Deprecated void setTransactionParameters(int isolationLevel, int[] parameters) throws java.sql.SQLExceptionDeprecated.Set transaction parameters for the specified isolation level. They will take effect only on the newly started transaction.- Parameters:
isolationLevel- JDBC isolation level.parameters- array of TPB parameters, see all TPB_* constants.- Throws:
java.sql.SQLException- if specified transaction parameters cannot be set.
-
getTransactionParameters
TransactionParameterBuffer getTransactionParameters(int isolationLevel) throws java.sql.SQLException
Get transaction parameters for the specified transaction isolation level.- Parameters:
isolationLevel- isolation level defined in theConnectioninterface.- Returns:
- instance of
TransactionParameterBuffercontaining current transaction parameters. - Throws:
java.sql.SQLException- if error occurred obtaining transaction parameters.
-
createTransactionParameterBuffer
TransactionParameterBuffer createTransactionParameterBuffer() throws java.sql.SQLException
Create new instance ofTransactionParameterBuffer.- Returns:
- empty instance of
TransactionParameterBuffer. - Throws:
java.sql.SQLException- if error occurred during this operation.
-
setTransactionParameters
void setTransactionParameters(int isolationLevel, TransactionParameterBuffer tpb) throws java.sql.SQLExceptionSet transaction parameters for the specified transaction isolation level.This method replaces the default TPB mapping with the specified one, changes will be effective from the next transaction start.
- Parameters:
tpb- instance ofTransactionParameterBufferwith parameters to set.- Throws:
java.sql.SQLException- if error occurred during this operation.
-
setTransactionParameters
void setTransactionParameters(TransactionParameterBuffer tpb) throws java.sql.SQLException
Set transaction parameters for the next transactions.This method does not change the TPB mapping, but replaces the mapping for the current transaction isolation until
Connection.setTransactionIsolation(int)is called.Method cannot be called when transaction has already started.
- Parameters:
tpb- instance ofTransactionParameterBufferwith new transaction parameters.- Throws:
java.sql.SQLException- if method is called within a transaction.
-
isUseFirebirdAutoCommit
boolean isUseFirebirdAutoCommit()
- Returns:
trueif this connection is configured to useisc_tpb_autocommitwhen in auto commit.
-
getFbDatabase
@InternalApi FbDatabase getFbDatabase() throws java.sql.SQLException
Provides access to the low-level connection handle.WARNING using this connection handle directly may bring the JDBC connection in an inconsistent state.
- Returns:
- The low-level connection handle.
- Throws:
java.sql.SQLException
-
enquoteLiteral
java.lang.String enquoteLiteral(java.lang.String val) throws java.sql.SQLExceptionReturns a string appropriately quoted as a string literal for the connection dialect.This method is defined in
Connectionstarting with JDBC 4.5 (Java 26). The definition in this interface may be removed without notice once Jaybird only supports Java versions that expect JDBC 4.5 or higher.- Parameters:
val- a character string- Returns:
- for dialect 3, a string enclosed by single quotes with every single quote converted to two single quotes, for dialect 1, with double quotes instead of single quotes.
- Throws:
java.lang.NullPointerException- ifvalisnulljava.sql.SQLException- for database access errors- Since:
- 5.0.12
-
enquoteNCharLiteral
java.lang.String enquoteNCharLiteral(java.lang.String val) throws java.sql.SQLExceptionReturns a string appropriately quoted as a string literal for the connection dialect.Implementations should call their implementation of
enquoteLiteral(String). Given the future removal of this method from this interface, we're not providing a default implementation in this interface. Contrary to the requirements stated in JDBC 4.5, the returned string is not prefixed withNas Firebird doesn't have NCHAR literals.This method is defined in
Connectionstarting with JDBC 4.5 (Java 26). The definition in this interface may be removed without notice once Jaybird only supports Java versions that expect JDBC 4.5 or higher.- Parameters:
val- a character string- Returns:
- for dialect 3, a string enclosed by single quotes with every single quote converted to two single quotes, for dialect 1, with double quotes instead of single quotes.
- Throws:
java.lang.NullPointerException- ifvalisnulljava.sql.SQLException- for database access errors- Since:
- 5.0.12
- See Also:
enquoteLiteral(String)
-
enquoteIdentifier
java.lang.String enquoteIdentifier(java.lang.String identifier, boolean alwaysDelimit) throws java.sql.SQLExceptionReturns a simple SQL identifier or a delimited identifier, as appropriate for the connection dialect.For dialect 3, if
identifieralready starts and ends in a double quote, we strip the quotes, unescape doubled double quotes, and requote and reescape. Reserved words known to Jaybird are not considered simple identifiers, and are always delimited.For dialect 1, if
identifieris not a simple identifier or ifalwaysDelimitistrue, this method will throw aSQLFeatureNotSupportedExceptionas dialect 1 does not support delimited identifiers.This method is defined in
Connectionstarting with JDBC 4.5 (Java 26). The definition in this interface may be removed without notice once Jaybird only supports Java versions that expect JDBC 4.5 or higher.- Parameters:
identifier- a SQL identifieralwaysDelimit- indicates if a simple SQL identifier should be returned as a delimited identifier- Returns:
- a simple SQL identifier or a delimited identifier
- Throws:
java.lang.NullPointerException- ifidentifierisnulljava.sql.SQLFeatureNotSupportedException- if the datasource does not support delimited identifiers andidentifieris not a simple identifier oralwaysDelimitistruejava.sql.SQLException- ifidentifieris not a valid identifier- Since:
- 5.0.12
- See Also:
isSimpleIdentifier(String)
-
isSimpleIdentifier
boolean isSimpleIdentifier(java.lang.String identifier) throws java.sql.SQLExceptionReturns whetheridentifieris a simple identifier.Reserved words known to Jaybird are not considered simple identifiers.
This method is defined in
Connectionstarting with JDBC 4.5 (Java 26). The definition in this interface may be removed without notice once Jaybird only supports Java versions that expect JDBC 4.5 or higher.- Parameters:
identifier- a SQL identifier- Returns:
trueif a simple SQL identifier,falseotherwise- Throws:
java.lang.NullPointerException- ifidentifierisnulljava.sql.SQLException- for database access errors- Since:
- 5.0.12
-
-