org.firebirdsql.jdbc

Interface FirebirdConnection

All Superinterfaces:
Connection
Known Implementing Classes:
AbstractConnection

public interface FirebirdConnection
extends Connection

Extension of Connection interface providing access to Firebird specific features.
Author:
Roman Rokytskyy

Field Summary

static int
TPB_CONCURRENCY
static int
TPB_CONSISTENCY
static int
TPB_NOWAIT
static int
TPB_NO_REC_VERSION
static int
TPB_READ
static int
TPB_READ_COMMITTED
static int
TPB_REC_VERSION
static int
TPB_WAIT
static int
TPB_WRITE

Method Summary

Blob
createBlob()
Create Blob object.
TransactionParameterBuffer
createTransactionParameterBuffer()
Create new instance of TransactionParameterBuffer.
int
getHoldability()
Retrieves the current holdability of ResultSet objects created using this Connection object.
String
getIscEncoding()
Get current ISC encoding.
TransactionParameterBuffer
getTransactionParameters(int isolationLevel)
Get transaction parameters for the specified transaction isolation level.
void
releaseSavepoint(FirebirdSavepoint savepoint)
Removes the given FirebirdSavepoint object from the current transaction.
void
rollback(FirebirdSavepoint savepoint)
Undoes all changes made after the given FirebirdSavepoint object was set.
FirebirdSavepoint
setFirebirdSavepoint()
Creates an unnamed savepoint in the current transaction and returns the new FirebirdSavepoint object that represents it.
FirebirdSavepoint
setFirebirdSavepoint(String name)
Creates a named savepoint in the current transaction and returns the new FirebirdSavepoint object that represents it.
void
setHoldability(int holdability)
Changes the holdability of ResultSet objects created using this Connection object to the given holdability.
void
setTransactionParameters(int isolationLevel, int[] parameters)
Deprecated. use setTransactionParameters(int,TransactionParameterBuffer) instead.
void
setTransactionParameters(int isolationLevel, TransactionParameterBuffer tpb)
Set transaction parameters for the specified transaction isolation level.
void
setTransactionParameters(TransactionParameterBuffer tpb)
Set transaction parameters for the next transactions.

Field Details

TPB_CONCURRENCY

public static final int TPB_CONCURRENCY
Field Value:
2

TPB_CONSISTENCY

public static final int TPB_CONSISTENCY
Field Value:
1

TPB_NOWAIT

public static final int TPB_NOWAIT
Field Value:
7

TPB_NO_REC_VERSION

public static final int TPB_NO_REC_VERSION
Field Value:
18

TPB_READ

public static final int TPB_READ
Field Value:
8

TPB_READ_COMMITTED

public static final int TPB_READ_COMMITTED
Field Value:
15

TPB_REC_VERSION

public static final int TPB_REC_VERSION
Field Value:
17

TPB_WAIT

public static final int TPB_WAIT
Field Value:
6

TPB_WRITE

public static final int TPB_WRITE
Field Value:
9

Method Details

createBlob

public Blob createBlob()
            throws SQLException
Create Blob object.

createTransactionParameterBuffer

public TransactionParameterBuffer createTransactionParameterBuffer()
            throws SQLException
Create new instance of TransactionParameterBuffer.
Returns:
empty instance of TransactionParameterBuffer.

getHoldability

public int getHoldability()
            throws SQLException
Retrieves the current holdability of ResultSet objects created using this Connection object.

Method copied from the JDBC 3.0 specification.

Returns:
the holdability, one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Since:
1.4

getIscEncoding

public String getIscEncoding()
            throws SQLException
Get current ISC encoding.
Returns:
current ISC encoding.

getTransactionParameters

public TransactionParameterBuffer getTransactionParameters(int isolationLevel)
            throws SQLException
Get transaction parameters for the specified transaction isolation level.
Parameters:
isolationLevel - isolation level defined in the Connection interface.
Returns:
instance of TransactionParameterBuffer containing current transaction parameters.

releaseSavepoint

public void releaseSavepoint(FirebirdSavepoint savepoint)
            throws SQLException
Removes the given FirebirdSavepoint object from the current transaction. Any reference to the savepoint after it have been removed will cause an SQLException to be thrown.

This method corresponds to the Connection.releaseSavepoint(Savepoint) method in JDBC 3.0.

Parameters:
savepoint - the FirebirdSavepoint object to be removed

rollback

public void rollback(FirebirdSavepoint savepoint)
            throws SQLException
Undoes all changes made after the given FirebirdSavepoint object was set.

This method corresponds to the Connection.rollback(Savepoint) method in JDBC 3.0.

Parameters:
savepoint - the FirebirdSavepoint object to roll back to

setFirebirdSavepoint

public FirebirdSavepoint setFirebirdSavepoint()
            throws SQLException
Creates an unnamed savepoint in the current transaction and returns the new FirebirdSavepoint object that represents it.

This method corresponds to the Connection.setSavepoint() method in JDBC 3.0.

Returns:
instance of FirebirdSavepoint

setFirebirdSavepoint

public FirebirdSavepoint setFirebirdSavepoint(String name)
            throws SQLException
Creates a named savepoint in the current transaction and returns the new FirebirdSavepoint object that represents it.

This method corresponds to the Connection.setSavepoint(String) method in JDBC 3.0.

Parameters:
name - a String containing the name of the savepoint
Returns:
instance of FirebirdSavepoint

setHoldability

public void setHoldability(int holdability)
            throws SQLException
Changes the holdability of ResultSet objects created using this Connection object to the given holdability.

Method copied from the JDBC 3.0 specification.

Parameters:
holdability - a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Since:
1.4

setTransactionParameters

public void setTransactionParameters(int isolationLevel,
                                     int[] parameters)
            throws SQLException

Deprecated. use setTransactionParameters(int,TransactionParameterBuffer) instead.

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.

setTransactionParameters

public void setTransactionParameters(int isolationLevel,
                                     TransactionParameterBuffer tpb)
            throws SQLException
Set 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:
isolationLevel - isolation level defined in the Connection interface.
tpb - instance of TransactionParameterBuffer with parameters to set.

setTransactionParameters

public void setTransactionParameters(TransactionParameterBuffer tpb)
            throws 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 of TransactionParameterBuffer with new transaction parameters.

Copyright B) 2001 David Jencks and other authors. All rights reserved.