be.SIRAPRISE.client
Class ReusableDBConnection

java.lang.Object
  extended by be.SIRAPRISE.client.DBConnection
      extended by be.SIRAPRISE.client.ReusableDBConnection

public final class ReusableDBConnection
extends DBConnection

A ReusableDBConnection has all the semantics of a DBConnection. It differs from a OneShotDBConnection in that the close() method does not actually close the connection. Instead, after invocation of the close() method on a reusable connection, the connection object will be freed for subsequent reuse.

Author:
Erwin

Constructor Summary
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, boolean initialAutoCommitForTransactions, long requestConnectionIdleTime, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, boolean initialAutoCommitForTransactions, long requestConnectionIdleTime, Signer signer)
          Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, boolean initialAutoCommitForTransactions, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, boolean initialAutoCommitForTransactions, Signer privateKeyProvider)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, long requestConnectionIdleTime, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, long requestConnectionIdleTime, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.util.Set<java.lang.String> signatureAlgorithmNames, java.lang.String clientID, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, boolean initialAutoCommitForTransactions, long requestConnectionIdleTime, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, boolean initialAutoCommitForTransactions, long requestConnectionIdleTime, Signer signer)
          Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, boolean initialAutoCommitForTransactions, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, boolean initialAutoCommitForTransactions, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, long requestConnectionIdleTime, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, long requestConnectionIdleTime, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, java.util.Set<java.lang.String> encryptionAlgorithmNames, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
ReusableDBConnection(java.lang.String host, int port, java.lang.String clientID, Signer signer)
          Creates a connection to the server on the specified host and port, and opens it for communication.
 
Method Summary
 void close()
          Closes the connection.
 
Methods inherited from class be.SIRAPRISE.client.DBConnection
commit, compileAndCacheQuery, compileQuery, endTransaction, execDmlCommand, execDmlCommandAndEndTransaction, execMultipleStatement, execMultipleStatement, execMultipleStatementAndEndTransaction, execMultipleStatementAndEndTransaction, execQueries, execQueriesAndEndTransaction, execQuery, execQueryAndEndTransaction, getDefaultTransactionAutoCommit, getSpecificationVersionForServer, isDefaultInitialAutoCommitForTransactions, isOpen, rollback, setDefaultTransactionAutoCommit, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            long requestConnectionIdleTime,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The ID identifying the client of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
encryptionAlgorithmNames - A specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            long requestConnectionIdleTime,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The ID identifying the client of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The userID identifying the user of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
encryptionAlgorithmNames - a specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            Signer privateKeyProvider)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The userID identifying the user of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
privateKeyProvider - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            long requestConnectionIdleTime,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The userID identifying the user of this connection to sira_prise
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
encryptionAlgorithmNames - a specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            long requestConnectionIdleTime,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The userID identifying the user of this connection to sira_prise
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The userID identifying the user of this connection to sira_prise
encryptionAlgorithmNames - a specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.util.Set<java.lang.String> signatureAlgorithmNames,
                            java.lang.String clientID,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
signatureAlgorithmNames - a specified set of usable signature algorithm names
clientID - The userID identifying the user of this connection to sira_prise
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            long requestConnectionIdleTime,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The ID identifying the client of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
encryptionAlgorithmNames - A specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            long requestConnectionIdleTime,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port with the given autoCommit setting, and opens it for communication.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The ID identifying the client of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The userID identifying the user of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
encryptionAlgorithmNames - a specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            boolean initialAutoCommitForTransactions,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The userID identifying the user of this connection to sira_prise
initialAutoCommitForTransactions - true if the transactions created on this connection should have their autocommit set to true
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            long requestConnectionIdleTime,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The userID identifying the user of this connection to sira_prise
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
encryptionAlgorithmNames - a specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            long requestConnectionIdleTime,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The userID identifying the user of this connection to sira_prise
requestConnectionIdleTime - The requested time in milliseconds that the connection is allowed to stay idle
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            java.util.Set<java.lang.String> encryptionAlgorithmNames,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The userID identifying the user of this connection to sira_prise
encryptionAlgorithmNames - a specified set of usable encryption protocol names
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake

ReusableDBConnection

public ReusableDBConnection(java.lang.String host,
                            int port,
                            java.lang.String clientID,
                            Signer signer)
                     throws java.io.IOException,
                            CommunicationProtocolException,
                            DBException
Creates a connection to the server on the specified host and port, and opens it for communication. AutoCommit will be OFF. The requested connection idle time is the default time configured in the client properties.

Parameters:
host - The identification of the host. It may either be its DNS name or its IP address in dotted decimal.
port - The port to which to connect.
clientID - The userID identifying the user of this connection to sira_prise
signer - The Signer object that will be called upon to compute the needed signature
Throws:
java.io.IOException - if an I/O error occurs when creating the TCP socket.
CommunicationProtocolException - If an unexpected message was received during the handshake
DBException - If an error was detected on the server during the handshake
Method Detail

close

public void close()
Description copied from class: DBConnection
Closes the connection. If an uncommitted transaction is still pending on the connection, it will be rolled back and ended.

Specified by:
close in class DBConnection