|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.gds.impl.GDSHelper
public class GDSHelper
Helper class for all GDS-related operations.
| Nested Class Summary | |
|---|---|
static interface |
GDSHelper.GDSHelperErrorListener
Notification listener about any error that occured in this class. |
| Field Summary | |
|---|---|
static byte[] |
BLOB_LENGTH_REQUEST
|
static int |
DEFAULT_BLOB_BUFFER_SIZE
|
protected DatabaseParameterBuffer |
dpb
Needed from mcf when killing a db handle when a new tx cannot be started. |
| Constructor Summary | |
|---|---|
GDSHelper(GDS gds,
DatabaseParameterBuffer dpb,
AbstractIscDbHandle dbHandle,
GDSHelper.GDSHelperErrorListener listener)
Create instance of this class. |
|
| Method Summary | |
|---|---|
AbstractIscStmtHandle |
allocateStatement()
Retrieve a newly allocated statment handle with the current connection. |
void |
clearWarnings()
Clear warnings for this database connection. |
void |
closeBlob(IscBlobHandle blob)
Close a blob that has been opened within the database. |
void |
closeStatement(AbstractIscStmtHandle stmt,
boolean deallocate)
Close a statement that is allocated in the database. |
void |
commitTransaction(AbstractIscTrHandle trHandle)
|
IscBlobHandle |
createBlob(boolean segmented)
Create a new blob within the current transaction. |
void |
detachDatabase()
|
void |
executeImmediate(String statement)
Execute a SQL statement directly with the current connection. |
void |
executeStatement(AbstractIscStmtHandle stmt,
boolean sendOutSqlda)
Execute a statement in the database. |
void |
fetch(AbstractIscStmtHandle stmt,
int fetchSize)
Fetch data from a statement in the database. |
int |
getBlobBufferLength()
Get the buffer length for blobs for this connection. |
byte[] |
getBlobInfo(IscBlobHandle blob,
byte[] requestItems,
int bufferLength)
|
int |
getBlobLength(IscBlobHandle blob)
|
byte[] |
getBlobSegment(IscBlobHandle blob,
int len)
Get a segment from a blob. |
IscDbHandle |
getCurrentDbHandle()
|
AbstractIscTrHandle |
getCurrentTrHandle()
|
DatabaseParameterBuffer |
getDatabaseParameterBuffer()
|
int |
getDatabaseProductMajorVersion()
Get the major version number of the database that we're connected to. |
int |
getDatabaseProductMinorVersion()
Get the minor version number of the database that we're connected to. |
String |
getDatabaseProductName()
Get the name of the database product that we're connected to. |
String |
getDatabaseProductVersion()
Get the version of the the database that we're connected to |
GDS |
getInternalAPIHandler()
Get Firebird API handler (sockets/native/embeded/etc) |
IscDbHandle |
getIscDBHandle()
Get connection handle for direct Firebird API access |
String |
getIscEncoding()
Get the encoding used for this connection. |
String |
getJavaEncoding()
|
String |
getMappingPath()
|
void |
getSqlCounts(AbstractIscStmtHandle stmt)
Fetch the count information for a statement handle. |
int |
getTransactionId(IscTrHandle trHandle)
|
String |
getUserName()
Get the database login name of the user that we're connected as. |
List |
getWarnings()
Get all warnings associated with current connection. |
boolean |
inTransaction()
Retrieve whether this connection is currently involved in a transaction |
int |
iscVaxInteger(byte[] buffer,
int pos,
int length)
|
IscBlobHandle |
openBlob(long blob_id,
boolean segmented)
Open a handle to a new blob within the current transaction with the given id. |
void |
populateStatementInfo(AbstractIscStmtHandle fixedStmt)
|
void |
prepareStatement(AbstractIscStmtHandle stmt,
String sql,
boolean describeBind)
Prepare an SQL string for execution (within the database server) in the context of a statement handle. |
void |
prepareTransaction(AbstractIscTrHandle trHandle,
byte[] message)
|
void |
putBlobSegment(IscBlobHandle blob,
byte[] buf)
Write a segment of data to a blob. |
void |
rollbackTransaction(AbstractIscTrHandle trHandle)
|
void |
seekBlob(IscBlobHandle blob,
int position,
int mode)
|
void |
setCurrentTrHandle(AbstractIscTrHandle currentTr)
|
void |
setCursorName(AbstractIscStmtHandle stmt,
String cursorName)
Set the cursor name for a statement. |
AbstractIscTrHandle |
startTransaction(TransactionParameterBuffer tpb)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_BLOB_BUFFER_SIZE
protected DatabaseParameterBuffer dpb
public static final byte[] BLOB_LENGTH_REQUEST
| Constructor Detail |
|---|
public GDSHelper(GDS gds,
DatabaseParameterBuffer dpb,
AbstractIscDbHandle dbHandle,
GDSHelper.GDSHelperErrorListener listener)
| Method Detail |
|---|
public AbstractIscTrHandle getCurrentTrHandle()
public void setCurrentTrHandle(AbstractIscTrHandle currentTr)
public IscDbHandle getCurrentDbHandle()
public DatabaseParameterBuffer getDatabaseParameterBuffer()
public AbstractIscStmtHandle allocateStatement()
throws GDSException
GDSException - if a database access error occurspublic boolean inTransaction()
true if this connection is currently in a
transaction, false otherwise.
public int getTransactionId(IscTrHandle trHandle)
throws GDSException
GDSException
public void prepareStatement(AbstractIscStmtHandle stmt,
String sql,
boolean describeBind)
throws GDSException,
SQLException
stmt - The statement handle within which the SQL statement will be
preparedsql - The SQL statement to be prepareddescribeBind - Send bind data to the database server
GDSException - if a Firebird-specific error occurs
SQLException - if a database access error occurs
public void executeStatement(AbstractIscStmtHandle stmt,
boolean sendOutSqlda)
throws GDSException
stmt - The handle to the statement to be executedsendOutSqlda - Determines if the XSQLDA structure should be sent to the
database
GDSException - if a Firebird-specific error occurs
public void executeImmediate(String statement)
throws GDSException
statement - The SQL statement to execute
GDSException - if a Firebird-specific error occurs
public void fetch(AbstractIscStmtHandle stmt,
int fetchSize)
throws GDSException
stmt - handle to the statement from which data will be fetchedfetchSize - The number of records to fetch
GDSException - if a Firebird-specific error occurs
public void setCursorName(AbstractIscStmtHandle stmt,
String cursorName)
throws GDSException
stmt - handle to statement for which the cursor name will be setcursorName - the name for the cursor
GDSException - if a Firebird-specific database access error occurs
public void closeStatement(AbstractIscStmtHandle stmt,
boolean deallocate)
throws GDSException
stmt - handle to the statement to be closeddeallocate - if true, the statement will be deallocated,
otherwise it will not be deallocated
GDSException - if a Firebird-specific database access error occurs
public void getSqlCounts(AbstractIscStmtHandle stmt)
throws GDSException
stmt - handle to the statement for which counts will be fetched
GDSException - if a Firebird-specific database access error occurs
public void populateStatementInfo(AbstractIscStmtHandle fixedStmt)
throws GDSException
GDSException
public IscBlobHandle openBlob(long blob_id,
boolean segmented)
throws GDSException
blob_id - The identifier to be given to the blobsegmented - If true, the blob will be segmented, otherwise
is will be streamed
GDSException - if a Firebird-specific database error occurs
public IscBlobHandle createBlob(boolean segmented)
throws GDSException
segmented - If true the blob will be segmented, otherwise
it will be streamed
GDSException - if a Firebird-specific database error occurs
public byte[] getBlobSegment(IscBlobHandle blob,
int len)
throws GDSException
blob - Handle to the blob from which the segment is to be fetchedlen - The maximum length to fetch
GDSException - if a Firebird-specific database access error occurs
public void closeBlob(IscBlobHandle blob)
throws GDSException
blob - Handle to the blob to be closed
GDSException - if a Firebird-specific database access error occurs
public void seekBlob(IscBlobHandle blob,
int position,
int mode)
throws GDSException
GDSException
public void putBlobSegment(IscBlobHandle blob,
byte[] buf)
throws GDSException
blob - handle to the blob to which data will be writtenbuf - segment of data to be written to the blob
GDSException - if a Firebird-specific database access error occurs
public byte[] getBlobInfo(IscBlobHandle blob,
byte[] requestItems,
int bufferLength)
throws GDSException
GDSException
public int getBlobLength(IscBlobHandle blob)
throws GDSException
GDSException
public AbstractIscTrHandle startTransaction(TransactionParameterBuffer tpb)
throws GDSException
GDSException
public void prepareTransaction(AbstractIscTrHandle trHandle,
byte[] message)
throws GDSException
GDSException
public void commitTransaction(AbstractIscTrHandle trHandle)
throws GDSException
GDSException
public void rollbackTransaction(AbstractIscTrHandle trHandle)
throws GDSException
GDSException
public void detachDatabase()
throws GDSException
GDSException
public int iscVaxInteger(byte[] buffer,
int pos,
int length)
public String getDatabaseProductName()
public String getDatabaseProductVersion()
public int getDatabaseProductMajorVersion()
public int getDatabaseProductMinorVersion()
public String getUserName()
public int getBlobBufferLength()
public String getIscEncoding()
public String getJavaEncoding()
public String getMappingPath()
public List getWarnings()
GDSExceptioninstances representing warnings for
this database connection.public void clearWarnings()
public IscDbHandle getIscDBHandle()
public GDS getInternalAPIHandler()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||