public class V10Database extends AbstractFbWireDatabase implements FbWireDatabase
FbWireDatabase implementation for the version 10 wire protocol.FbWireAttachment.AcceptPacketprotocolDescriptor, wireOperationsdatabaseListenerDispatcherconnection, exceptionListenerDispatcher| Modifier | Constructor and Description |
|---|---|
protected |
V10Database(WireDatabaseConnection connection,
ProtocolDescriptor descriptor)
Creates a V10Database instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterAttachActions()
Additional tasks to execute directly after attach operation.
|
void |
attach()
Attach to the attachment type.
|
protected void |
attachOrCreate(DatabaseParameterBuffer dpb,
boolean create) |
void |
authReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket)
Receive authentication response from the server.
|
void |
cancelOperation(int kind)
Cancels the current operation.
|
void |
createDatabase()
Creates a new database, connection remains attached to database.
|
FbStatement |
createStatement(FbTransaction transaction)
Creates a statement associated with a transaction
|
protected void |
doReleaseObjectPacket(int operation,
int objectId)
Sends - without flushing - the (release) operation and objectId.
|
void |
dropDatabase()
Drops (and deletes) the currently attached database.
|
void |
executeImmediate(java.lang.String statementText,
FbTransaction transaction)
Performs an execute immediate of a statement.
|
BlrCalculator |
getBlrCalculator() |
protected Encoding |
getFilenameEncoding(DatabaseParameterBuffer dpb)
Gets the
Encoding to use for the database filename. |
protected byte[] |
getTransactionIdBuffer(long transactionId) |
FbWireAsynchronousChannel |
initAsynchronousChannel()
Initializes the asynchronous channel (for event notification).
|
protected void |
internalDetach()
Actual implementation of database detach.
|
protected void |
processAttachOrCreateResponse(GenericResponse genericResponse)
Processes the response from the server to the attach or create operation.
|
protected void |
processReleaseObjectResponse(Response response)
Process the release object response
|
FbTransaction |
reconnectTransaction(long transactionId)
Reconnects a prepared transaction.
|
void |
releaseObject(int operation,
int objectId)
Release object.
|
protected void |
sendAttachOrCreateToBuffer(DatabaseParameterBuffer dpb,
boolean create)
Sends the buffer for op_attach or op_create
|
FbWireTransaction |
startTransaction(TransactionParameterBuffer tpb)
Creates and starts a transaction.
|
cancelEvent, checkAttached, checkConnected, closeConnection, consumePackets, countEvents, createBlobForInput, createBlobForOutput, createEventHandle, enqueueDeferredAction, finalize, forceClose, getDatabaseInfo, getHandle, getInfo, getXdrIn, getXdrOut, getXdrStreamAccess, isAttached, queueEvent, readGenericResponse, readResponse, readSqlResponse, setNetworkTimeoutaddDatabaseListener, addWeakDatabaseListener, close, createBlobParameterBuffer, createTransactionParameterBuffer, emptyRowDescriptor, getActiveTransactionCount, getConnectionDialect, getConnectionProperties, getDatabaseDialect, getDatabaseInfo, getDatabaseInformationProcessor, getDatabaseWarningCallback, getDescribeDatabaseInfoBlock, getOdsMajor, getOdsMinor, getParameterDescriptionInfoRequestItems, getStatementInfoRequestItems, removeDatabaseListener, setDatabaseDialect, setOdsMajor, setOdsMinor, transactionAdded, transactionStateChangedaddExceptionListener, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, getServerVersionInformation, isLockedByCurrentThread, removeExceptionListener, safelyDetach, setAttached, setDetached, setServerVersion, withLockclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconsumePackets, enqueueDeferredAction, getInfo, readResponse, readSqlResponseaddDatabaseListener, addWeakDatabaseListener, cancelEvent, countEvents, createBlobForInput, createBlobForInput, createBlobForInput, createBlobForOutput, createBlobForOutput, createBlobForOutput, createBlobParameterBuffer, createEventHandle, createTransactionParameterBuffer, emptyRowDescriptor, getConnectionDialect, getConnectionProperties, getDatabaseDialect, getDatabaseInfo, getDatabaseInfo, getHandle, getOdsMajor, getOdsMinor, queueEvent, removeDatabaseListenergetXdrStreamAccess, readGenericResponseclose, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, isAttached, isLockedByCurrentThread, setNetworkTimeout, withLockaddExceptionListener, removeExceptionListenerprotected V10Database(WireDatabaseConnection connection, ProtocolDescriptor descriptor)
connection - A WireConnection with an established connection to the server.descriptor - The ProtocolDescriptor that created this connection (this is
used for creating further dependent objects).public final void attach()
throws java.sql.SQLException
FbAttachmentattach in interface FbAttachmentjava.sql.SQLExceptionprotected final void attachOrCreate(DatabaseParameterBuffer dpb, boolean create) throws java.sql.SQLException
dpb - Database parameter buffercreate - true create database, false only
attachjava.sql.SQLException - For errors during attach or createprotected final void sendAttachOrCreateToBuffer(DatabaseParameterBuffer dpb, boolean create) throws java.sql.SQLException, java.io.IOException
dpb - Database parameter buffercreate - true create database, false only
attachjava.sql.SQLException - If the connection is not openjava.io.IOException - For errors writing to the connectionprotected Encoding getFilenameEncoding(DatabaseParameterBuffer dpb)
Encoding to use for the database filename.dpb - Database parameter bufferprotected final void processAttachOrCreateResponse(GenericResponse genericResponse)
genericResponse - GenericResponse received from the server.protected final void afterAttachActions()
throws java.sql.SQLException
Implementation retrieves database information like dialect ODS and server version.
java.sql.SQLException - For errors reading or writing database information.protected final void internalDetach()
throws java.sql.SQLException
AbstractFbDatabase
Implementations of this method should only be called from AbstractFbDatabase.close(), and should not
notify database listeners of the database DatabaseListener.detaching(FbDatabase) and
DatabaseListener.detached(FbDatabase) events.
internalDetach in class AbstractFbDatabase<WireDatabaseConnection>java.sql.SQLExceptionpublic final void createDatabase()
throws java.sql.SQLException
FbDatabasecreateDatabase in interface FbDatabasejava.sql.SQLExceptionpublic final void dropDatabase()
throws java.sql.SQLException
FbDatabasedropDatabase in interface FbDatabasejava.sql.SQLExceptionpublic final FbWireTransaction startTransaction(TransactionParameterBuffer tpb) throws java.sql.SQLException
FbDatabasestartTransaction in interface FbDatabasetpb - TransactionParameterBuffer with the required transaction
optionsjava.sql.SQLExceptionpublic final FbTransaction reconnectTransaction(long transactionId) throws java.sql.SQLException
FbDatabaseReconnecting transactions is only allowed for transactions in limbo (prepared, but not committed or rolled back).
reconnectTransaction in interface FbDatabasetransactionId - The id of the transaction to reconnect.java.sql.SQLException - For errors reconnecting the transactionprotected byte[] getTransactionIdBuffer(long transactionId)
public final FbStatement createStatement(FbTransaction transaction) throws java.sql.SQLException
FbDatabasecreateStatement in interface FbDatabasetransaction - FbTransaction to associate with this statement (can be null)java.sql.SQLExceptionpublic void cancelOperation(int kind)
throws java.sql.SQLException
FbDatabaseThe cancellation types are:
ISCConstants.fb_cancel_disableISCConstants.fb_cancel_enableISCConstants.fb_cancel_raiseISCConstants.fb_cancel_abortcancelOperation in interface FbDatabasekind - Cancellation typejava.sql.SQLException - For errors cancelling, or if the cancel operation is not supported.public final void executeImmediate(java.lang.String statementText,
FbTransaction transaction)
throws java.sql.SQLException
FbDatabase
A call to this method is the equivalent of a isc_dsql_execute_immediate() without parameters.
executeImmediate in interface FbDatabasestatementText - Statement texttransaction - Transaction (null only allowed if database is not attached!)java.sql.SQLException - For errors executing the statement, or if transaction is null when the database is
attached or not null when the database is not attachedpublic void releaseObject(int operation,
int objectId)
throws java.sql.SQLException
FbWireDatabasereleaseObject in interface FbWireDatabaseoperation - OperationobjectId - ID of the object to releasejava.sql.SQLExceptionpublic final FbWireAsynchronousChannel initAsynchronousChannel() throws java.sql.SQLException
AbstractFbWireDatabaseinitAsynchronousChannel in class AbstractFbWireDatabasejava.sql.SQLException - For errors establishing the channel, or if the channel already exists.protected final void doReleaseObjectPacket(int operation,
int objectId)
throws java.io.IOException,
java.sql.SQLException
operation - OperationobjectId - Id of the object to releasejava.io.IOException - For errors writing to the connectionjava.sql.SQLException - If the database connection is not availableprotected final void processReleaseObjectResponse(Response response)
response - The response objectpublic final BlrCalculator getBlrCalculator()
getBlrCalculator in interface FbWireDatabaseBlrCalculator instance for this database.public final void authReceiveResponse(FbWireAttachment.AcceptPacket acceptPacket) throws java.io.IOException, java.sql.SQLException
FbWireAttachmentThis method is only relevant for protocol V13 or higher.
authReceiveResponse in interface FbWireAttachmentacceptPacket - Packet with op_cond_accept data, or null when the data should be read from the
connection.java.io.IOException - For errors reading the response from the connection.java.sql.SQLException - For errors returned from the server, or when attempting to
read.Copyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.