Top Description Fields Constructors Methods
org.hsqldb

public Class ClientConnection

extends Object
implements SessionInterface, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.hsqldb.SessionInterface
Known Direct Subclasses
org.hsqldb.ClientConnectionHTTP
Imports
java.io.BufferedInputStream, .DataInputStream, .IOException, java.net.Socket, java.text.SimpleDateFormat, java.util.Calendar, .GregorianCalendar, .TimeZone, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.jdbc.JDBCConnection, org.hsqldb.lib.DataOutputStream, org.hsqldb.map.ValuePool, org.hsqldb.navigator.RowSetNavigatorClient, org.hsqldb.persist.HsqlProperties, org.hsqldb.result.Result, .ResultConstants, .ResultLob, org.hsqldb.rowio.RowInputBinary, .RowOutputBinary, .RowOutputInterface, org.hsqldb.server.HsqlSocketFactory, org.hsqldb.types.BlobDataID, .ClobDataID, .HsqlDateTime

Base remote session proxy implementation. Uses instances of Result to transmit and receive data. This implementation utilises the updated HSQL protocol.
Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.2
Version
2.7.3

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private Calendar
private Calendar
pack-priv HsqlProperties
pack-priv String
pack-priv JDBCConnection
pack-priv String
pack-priv int
pack-priv String
protected DataInputStream
protected DataOutputStream
pack-priv String
private boolean
private boolean
private boolean
pack-priv boolean
pack-priv boolean
private long
pack-priv final byte[]
public static final String
NETWORK_COMPATIBILITY_VERSION

Specifies the Compatibility version required for both Servers and network JDBC Clients built with this baseline.

public static final int
pack-priv String
pack-priv int
protected int
private Result
protected RowInputBinary
protected RowOutputInterface
private Scanner
private long
pack-priv SimpleDateFormat
private Socket
private TimeZone

Constructor Summary

AccessConstructor and Description
public
ClientConnection(String host, int port, String path, String database, boolean isTLS, boolean isTLSWrapper, String user, String password, TimeZone timeZone)

Establishes a connection to the server.

protected

Method Summary

Modifier and TypeMethod and Description
public void
public Result
public Result
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public synchronized void
protected void
public synchronized void
public synchronized void
commit(boolean chain)

Implements org.hsqldb.SessionInterface.commit.

public BlobDataID
public ClobDataID
public synchronized Result
public synchronized Object
public static Object
getAttributeFromData(Result result, int id)

public Calendar
public Calendar
public HsqlProperties
public String
public synchronized long
public synchronized String
public synchronized int
public JDBCConnection
public synchronized long
public int
public synchronized RowSetNavigatorClient
getRows(long navigatorId, int offset, int size)

Implements org.hsqldb.SessionInterface.getRows.

public Scanner
public Session
public SimpleDateFormat
public int
public TimeZone
public int
protected void
protected void
initConnection(String host, int port, boolean isTLS)

private void
initStructures()

resultOut is reused to transmit all remote calls for session management.

public synchronized boolean
public synchronized boolean
public synchronized boolean
protected void
openConnection(String host, int port, boolean isTLS)

public synchronized void
protected Result
read()

public synchronized void
public synchronized void
resetSession()

Implements org.hsqldb.SessionInterface.resetSession.

Used by pooled connections to reset the server-side session to a new one.

public synchronized void
public synchronized void
public synchronized void
public synchronized void
public void
public static Result
setAttributeResult(Result result, int id, Object value)

public synchronized void
public synchronized void
public void
public synchronized void
public synchronized void
public static String
toNetCompVersionString(int i)

Converts specified encoded integer to a Network Compatibility Version String.

protected void
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUFFER_SIZEback to summary
pack-priv static final int BUFFER_SIZE
calendarback to summary
private Calendar calendar
calendarGMTback to summary
private Calendar calendarGMT
clientPropertiesback to summary
pack-priv HsqlProperties clientProperties
clientPropertiesStringback to summary
pack-priv String clientPropertiesString
connectionback to summary
pack-priv JDBCConnection connection
databaseback to summary
pack-priv String database
databaseIDback to summary
pack-priv int databaseID
databaseUniqueNameback to summary
pack-priv String databaseUniqueName
dataInputback to summary
protected DataInputStream dataInput
dataOutputback to summary
protected DataOutputStream dataOutput
hostback to summary
pack-priv String host
isAutoCommitback to summary
private boolean isAutoCommit
isClosedback to summary
private boolean isClosed
isReadOnlyDefaultback to summary
private boolean isReadOnlyDefault
isTLSback to summary
pack-priv boolean isTLS
isTLSWrapperback to summary
pack-priv boolean isTLSWrapper
lobIDSequenceback to summary
private long lobIDSequence
mainBufferback to summary
pack-priv final byte[] mainBuffer
NETWORK_COMPATIBILITY_VERSIONback to summary
public static final String NETWORK_COMPATIBILITY_VERSION

Specifies the Compatibility version required for both Servers and network JDBC Clients built with this baseline. Must remain public for Server to have visibility to it. Update this value only when the current version of HSQLDB does not have inter-compatibility with Server and network JDBC Driver of the previous HSQLDB version. Must specify all 4 version segments (any segment may be the value 0, however). The string elements at (position p from right counted from 0) are multiplied by 100 to power p and added up, then negated, to form the integer representation of version string.

NETWORK_COMPATIBILITY_VERSION_INTback to summary
public static final int NETWORK_COMPATIBILITY_VERSION_INT
pathback to summary
pack-priv String path
portback to summary
pack-priv int port
randomIDback to summary
protected int randomID
resultOutback to summary
private Result resultOut
rowInback to summary
protected RowInputBinary rowIn
rowOutback to summary
protected RowOutputInterface rowOut
scannerback to summary
private Scanner scanner
sessionIDback to summary
private long sessionID
simpleDateFormatGMTback to summary
pack-priv SimpleDateFormat simpleDateFormatGMT
socketback to summary
private Socket socket
timeZoneback to summary
private TimeZone timeZone

Constructor Detail

ClientConnectionback to summary
public ClientConnection(String host, int port, String path, String database, boolean isTLS, boolean isTLSWrapper, String user, String password, TimeZone timeZone)

Establishes a connection to the server.

ClientConnectionback to summary
protected ClientConnection(ClientConnection other)

Method Detail

addWarningback to summary
public void addWarning(HsqlException warning)

Implements org.hsqldb.SessionInterface.addWarning.

allocateResultLobback to summary
public Result allocateResultLob(ResultLob resultLob)

Implements org.hsqldb.SessionInterface.allocateResultLob.

Does nothing here

cancelback to summary
public Result cancel(Result result)

Implements org.hsqldb.SessionInterface.cancel.

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
closeback to summary
public synchronized void close()

Implements org.hsqldb.SessionInterface.close.

closeConnectionback to summary
protected void closeConnection()
closeNavigatorback to summary
public synchronized void closeNavigator(long navigatorId)

Implements org.hsqldb.SessionInterface.closeNavigator.

commitback to summary
public synchronized void commit(boolean chain)

Implements org.hsqldb.SessionInterface.commit.

createBlobback to summary
public BlobDataID createBlob(long length)

Implements org.hsqldb.SessionInterface.createBlob.

createClobback to summary
public ClobDataID createClob(long length)

Implements org.hsqldb.SessionInterface.createClob.

executeback to summary
public synchronized Result execute(Result r)

Implements org.hsqldb.SessionInterface.execute.

getAttributeback to summary
public synchronized Object getAttribute(int id)

Implements org.hsqldb.SessionInterface.getAttribute.

getAttributeFromDataback to summary
public static Object getAttributeFromData(Result result, int id)
getCalendarback to summary
public Calendar getCalendar()

Implements org.hsqldb.SessionInterface.getCalendar.

getCalendarGMTback to summary
public Calendar getCalendarGMT()

Implements org.hsqldb.SessionInterface.getCalendarGMT.

getClientPropertiesback to summary
public HsqlProperties getClientProperties()

Implements org.hsqldb.SessionInterface.getClientProperties.

getDatabaseUniqueNameback to summary
public String getDatabaseUniqueName()

Implements org.hsqldb.SessionInterface.getDatabaseUniqueName.

getIdback to summary
public synchronized long getId()

Implements org.hsqldb.SessionInterface.getId.

getInternalConnectionURLback to summary
public synchronized String getInternalConnectionURL()

Implements org.hsqldb.SessionInterface.getInternalConnectionURL.

Never called on this class

getIsolationback to summary
public synchronized int getIsolation()

Implements org.hsqldb.SessionInterface.getIsolation.

getJDBCConnectionback to summary
public JDBCConnection getJDBCConnection()

Implements org.hsqldb.SessionInterface.getJDBCConnection.

getLobIdback to summary
public synchronized long getLobId()
getRandomIdback to summary
public int getRandomId()

Implements org.hsqldb.SessionInterface.getRandomId.

getRowsback to summary
public synchronized RowSetNavigatorClient getRows(long navigatorId, int offset, int size)

Implements org.hsqldb.SessionInterface.getRows.

getScannerback to summary
public Scanner getScanner()

Implements org.hsqldb.SessionInterface.getScanner.

getSessionback to summary
public Session getSession()
getSimpleDateFormatGMTback to summary
public SimpleDateFormat getSimpleDateFormatGMT()

Implements org.hsqldb.SessionInterface.getSimpleDateFormatGMT.

getStreamBlockSizeback to summary
public int getStreamBlockSize()

Implements org.hsqldb.SessionInterface.getStreamBlockSize.

getTimeZoneback to summary
public TimeZone getTimeZone()

Implements org.hsqldb.SessionInterface.getTimeZone.

getZoneSecondsback to summary
public int getZoneSeconds()

Implements org.hsqldb.SessionInterface.getZoneSeconds.

handshakeback to summary
protected void handshake() throws IOException
initConnectionback to summary
protected void initConnection(String host, int port, boolean isTLS)
initStructuresback to summary
private void initStructures()

resultOut is reused to transmit all remote calls for session management. Here the structure is preset for sending attributes.

isAutoCommitback to summary
public synchronized boolean isAutoCommit()

Implements org.hsqldb.SessionInterface.isAutoCommit.

isClosedback to summary
public synchronized boolean isClosed()

Implements org.hsqldb.SessionInterface.isClosed.

isReadOnlyDefaultback to summary
public synchronized boolean isReadOnlyDefault()

Implements org.hsqldb.SessionInterface.isReadOnlyDefault.

openConnectionback to summary
protected void openConnection(String host, int port, boolean isTLS)
prepareCommitback to summary
public synchronized void prepareCommit()

Implements org.hsqldb.SessionInterface.prepareCommit.

readback to summary
protected Result read() throws IOException, HsqlException
releaseSavepointback to summary
public synchronized void releaseSavepoint(String name)

Implements org.hsqldb.SessionInterface.releaseSavepoint.

resetSessionback to summary
public synchronized void resetSession()

Implements org.hsqldb.SessionInterface.resetSession.

Used by pooled connections to reset the server-side session to a new one. In case of failure, the connection is closed. When the Connection.close() method is called, a pooled connection calls this method instead of HSQLClientConnection.close(). It can then reuse the HSQLClientConnection object with no further initialisation.

rollbackback to summary
public synchronized void rollback(boolean chain)

Implements org.hsqldb.SessionInterface.rollback.

rollbackToSavepointback to summary
public synchronized void rollbackToSavepoint(String name)

Implements org.hsqldb.SessionInterface.rollbackToSavepoint.

savepointback to summary
public synchronized void savepoint(String name)

Implements org.hsqldb.SessionInterface.savepoint.

setAttributeback to summary
public synchronized void setAttribute(int id, Object value)

Implements org.hsqldb.SessionInterface.setAttribute.

setAttributeFromResultback to summary
public void setAttributeFromResult(Result result)

Implements org.hsqldb.SessionInterface.setAttributeFromResult.

setAttributeResultback to summary
public static Result setAttributeResult(Result result, int id, Object value)
setAutoCommitback to summary
public synchronized void setAutoCommit(boolean mode)

Implements org.hsqldb.SessionInterface.setAutoCommit.

setIsolationDefaultback to summary
public synchronized void setIsolationDefault(int level)

Implements org.hsqldb.SessionInterface.setIsolationDefault.

setJDBCConnectionback to summary
public void setJDBCConnection(JDBCConnection connection)

Implements org.hsqldb.SessionInterface.setJDBCConnection.

setReadOnlyDefaultback to summary
public synchronized void setReadOnlyDefault(boolean mode)

Implements org.hsqldb.SessionInterface.setReadOnlyDefault.

startPhasedTransactionback to summary
public synchronized void startPhasedTransaction()

Implements org.hsqldb.SessionInterface.startPhasedTransaction.

toNetCompVersionStringback to summary
public static String toNetCompVersionString(int i)

Converts specified encoded integer to a Network Compatibility Version String. The transmitted integer is negative to distinguish it from 7 bit ASCII characters.

writeback to summary
protected void write(Result r) throws IOException, HsqlException