java.lang.Object
org.firebirdsql.gds.impl.GDSHelper
Helper class for all GDS-related operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve a newly allocated statement handle with the current connection.void
Cancel the currently running operation.int
compareToVersion
(int major) Compares the version of this database to the specified major version.int
compareToVersion
(int major, int minor) Compares the version of this database to the specified major and minor version.createBlob
(BlobConfig blobConfig) Create a new blob within the current transaction.void
void
executeImmediate
(String statement) Execute a SQL statement directly with the current connection.int
Get the major version number of the database that we're connected to.int
Get the minor version number of the database that we're connected to.Get the name of the database product that we're connected to.Get the version of the database that we're connected to.int
Get the session time zone as configured in the connection property.Get the database login name of the user that we're connected as.boolean
Retrieve whether this connection is currently involved in a transactionopenBlob
(long blobId, BlobConfig blobConfig) Open a handle to a new blob within the current transaction with the given id.void
setCurrentTransaction
(FbTransaction transaction) Deprecated, for removal: This API element is subject to removal in a future version.withLock()
-
Constructor Details
-
GDSHelper
Create instance of this class.
-
-
Method Details
-
getCurrentTransaction
-
setCurrentTransaction
-
getCurrentDatabase
-
getConnectionProperties
-
getDialect
public int getDialect()- Returns:
- Connection dialect
-
allocateStatement
Retrieve a newly allocated statement handle with the current connection.- Returns:
- The new statement handle
- Throws:
SQLException
- if a database access error occurs
-
inTransaction
public boolean inTransaction()Retrieve whether this connection is currently involved in a transaction- Returns:
true
if this connection is currently in a transaction,false
otherwise.
-
executeImmediate
Execute a SQL statement directly with the current connection.- Parameters:
statement
- The SQL statement to execute- Throws:
SQLException
- if a Firebird-specific error occurs
-
openBlob
Open a handle to a new blob within the current transaction with the given id.- Parameters:
blobId
- the identifier to be given to the blobblobConfig
- blob configuration- Throws:
SQLException
- if a Firebird-specific database error occurs
-
createBlob
Create a new blob within the current transaction.- Parameters:
blobConfig
- blob configuration- Throws:
SQLException
- if a Firebird-specific database error occurs
-
startTransaction
@Deprecated(forRemoval=true, since="6") public FbTransaction startTransaction(TransactionParameterBuffer tpb) throws SQLException Deprecated, for removal: This API element is subject to removal in a future version.Will be removed in Jaybird 7, useFbDatabase.startTransaction(TransactionParameterBuffer)
andsetCurrentTransaction(FbTransaction)
- Throws:
SQLException
-
detachDatabase
- Throws:
SQLException
-
cancelOperation
Cancel the currently running operation.- Throws:
SQLException
-
getDatabaseProductName
Get the name of the database product that we're connected to.- Returns:
- The database product name (i.e. Firebird or Interbase)
-
getDatabaseProductVersion
Get the version of the database that we're connected to.- Returns:
- the database product version
-
getDatabaseProductMajorVersion
public int getDatabaseProductMajorVersion()Get the major version number of the database that we're connected to.- Returns:
- The major version number of the database
-
getDatabaseProductMinorVersion
public int getDatabaseProductMinorVersion()Get the minor version number of the database that we're connected to.- Returns:
- The minor version number of the database
-
compareToVersion
public int compareToVersion(int major, int minor) Compares the version of this database to the specified major and minor version.This method follows the semantics of
Comparable
: returns a negative value if the version of this database connection is smaller than the supplied arguments, 0 if they are equal or positive if its bigger.- Parameters:
major
- Major version to compareminor
- Minor version to compare- Returns:
- a negative integer, zero, or a positive integer as this database version is less than, equal to, or greater than the specified major and minor version
- See Also:
-
compareToVersion
public int compareToVersion(int major) Compares the version of this database to the specified major version.This method follows the semantics of
Comparable
: returns a negative value if the version of this database connection is smaller than the supplied arguments, 0 if they are equal or positive if its bigger.- Parameters:
major
- Major version to compare- Returns:
- a negative integer, zero, or a positive integer as this database version is less than, equal to, or greater than the specified major version
- See Also:
-
getUserName
Get the database login name of the user that we're connected as.- Returns:
- The username of the current database user
-
getSessionTimeZone
Get the session time zone as configured in the connection property.NOTE: This is not necessarily the actual server time zone.
- Returns:
- Value of connection property
sessionTimeZone
-
withLock
- See Also:
-
FbDatabase.startTransaction(TransactionParameterBuffer)
andsetCurrentTransaction(FbTransaction)