Package org.firebirdsql.gds.impl
Class GDSHelper
- java.lang.Object
- 
- org.firebirdsql.gds.impl.GDSHelper
 
- 
- All Implemented Interfaces:
- Synchronizable
 
 public final class GDSHelper extends java.lang.Object implements Synchronizable Helper class for all GDS-related operations.
- 
- 
Field SummaryFields Modifier and Type Field Description static intDEFAULT_BLOB_BUFFER_SIZE
 - 
Constructor SummaryConstructors Constructor Description GDSHelper(FbDatabase database)Create instance of this class.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description FbStatementallocateStatement()Retrieve a newly allocated statement handle with the current connection.voidcancelOperation()Cancel the currently running operation.intcompareToVersion(int major, int minor)Compares the version of this database to the specified major and minor version.FbBlobcreateBlob(boolean segmented)Create a new blob within the current transaction.voiddetachDatabase()voidexecuteImmediate(java.lang.String statement)Execute a SQL statement directly with the current connection.intgetBlobBufferLength()Get the buffer length for blobs for this connection.IConnectionPropertiesgetConnectionProperties()FbDatabasegetCurrentDatabase()FbTransactiongetCurrentTransaction()DatabaseParameterBuffergetDatabaseParameterBuffer()intgetDatabaseProductMajorVersion()Get the major version number of the database that we're connected to.intgetDatabaseProductMinorVersion()Get the minor version number of the database that we're connected to.java.lang.StringgetDatabaseProductName()Get the name of the database product that we're connected to.java.lang.StringgetDatabaseProductVersion()Get the version of the the database that we're connected tointgetDialect()java.lang.StringgetIscEncoding()Get the encoding used for this connection.java.lang.StringgetJavaEncoding()java.util.TimeZonegetSessionTimeZone()Get the session time zone as configured in the connection property.java.lang.ObjectgetSynchronizationObject()Get synchronization object.java.lang.StringgetUserName()Get the database login name of the user that we're connected as.booleaninTransaction()Retrieve whether this connection is currently involved in a transactionFbBlobopenBlob(long blob_id, boolean segmented)Open a handle to a new blob within the current transaction with the given id.voidsetCurrentTransaction(FbTransaction transaction)FbTransactionstartTransaction(TransactionParameterBuffer tpb)
 
- 
- 
- 
Field Detail- 
DEFAULT_BLOB_BUFFER_SIZEpublic static final int DEFAULT_BLOB_BUFFER_SIZE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
GDSHelperpublic GDSHelper(FbDatabase database) Create instance of this class.
 
- 
 - 
Method Detail- 
getCurrentTransactionpublic FbTransaction getCurrentTransaction() 
 - 
setCurrentTransactionpublic void setCurrentTransaction(FbTransaction transaction) 
 - 
getCurrentDatabasepublic FbDatabase getCurrentDatabase() 
 - 
getConnectionPropertiespublic IConnectionProperties getConnectionProperties() 
 - 
getDatabaseParameterBufferpublic DatabaseParameterBuffer getDatabaseParameterBuffer() 
 - 
getDialectpublic int getDialect() - Returns:
- Connection dialect
 
 - 
allocateStatementpublic FbStatement allocateStatement() throws java.sql.SQLException Retrieve a newly allocated statement handle with the current connection.- Returns:
- The new statement handle
- Throws:
- java.sql.SQLException- if a database access error occurs
 
 - 
inTransactionpublic boolean inTransaction() Retrieve whether this connection is currently involved in a transaction- Returns:
- trueif this connection is currently in a transaction,- falseotherwise.
 
 - 
executeImmediatepublic void executeImmediate(java.lang.String statement) throws java.sql.SQLExceptionExecute a SQL statement directly with the current connection.- Parameters:
- statement- The SQL statement to execute
- Throws:
- java.sql.SQLException- if a Firebird-specific error occurs
 
 - 
openBlobpublic FbBlob openBlob(long blob_id, boolean segmented) throws java.sql.SQLException Open a handle to a new blob within the current transaction with the given id.- Parameters:
- blob_id- The identifier to be given to the blob
- segmented- If- true, the blob will be segmented, otherwise is will be streamed
- Throws:
- java.sql.SQLException- if a Firebird-specific database error occurs
 
 - 
createBlobpublic FbBlob createBlob(boolean segmented) throws java.sql.SQLException Create a new blob within the current transaction.- Parameters:
- segmented- If- truethe blob will be segmented, otherwise it will be streamed
- Throws:
- java.sql.SQLException- if a Firebird-specific database error occurs
 
 - 
startTransactionpublic FbTransaction startTransaction(TransactionParameterBuffer tpb) throws java.sql.SQLException - Throws:
- java.sql.SQLException
 
 - 
detachDatabasepublic void detachDatabase() throws java.sql.SQLException- Throws:
- java.sql.SQLException
 
 - 
cancelOperationpublic void cancelOperation() throws java.sql.SQLExceptionCancel the currently running operation.- Throws:
- java.sql.SQLException
 
 - 
getDatabaseProductNamepublic java.lang.String getDatabaseProductName() Get the name of the database product that we're connected to.- Returns:
- The database product name (i.e. Firebird or Interbase)
 
 - 
getDatabaseProductVersionpublic java.lang.String getDatabaseProductVersion() Get the version of the the database that we're connected to- Returns:
- the database product version
 
 - 
getDatabaseProductMajorVersionpublic int getDatabaseProductMajorVersion() Get the major version number of the database that we're connected to.- Returns:
- The major version number of the database
 
 - 
getDatabaseProductMinorVersionpublic int getDatabaseProductMinorVersion() Get the minor version number of the database that we're connected to.- Returns:
- The minor version number of the database
 
 - 
compareToVersionpublic 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 compare
- minor- 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
 
 - 
getUserNamepublic java.lang.String getUserName() Get the database login name of the user that we're connected as.- Returns:
- The username of the current database user
 
 - 
getBlobBufferLengthpublic int getBlobBufferLength() Get the buffer length for blobs for this connection.- Returns:
- The length of blob buffers
 
 - 
getIscEncodingpublic java.lang.String getIscEncoding() Get the encoding used for this connection.- Returns:
- The name of the encoding used
 
 - 
getJavaEncodingpublic java.lang.String getJavaEncoding() 
 - 
getSessionTimeZonepublic java.util.TimeZone 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
 
 - 
getSynchronizationObjectpublic java.lang.Object getSynchronizationObject() Description copied from interface:SynchronizableGet synchronization object.- Specified by:
- getSynchronizationObjectin interface- Synchronizable
- Returns:
- object, cannot be null.
 
 
- 
 
-