org.hsqldb
Class ClientConnection
- java.lang.Object
-
- org.hsqldb.ClientConnection
-
- All Implemented Interfaces:
- SessionInterface
- Direct Known Subclasses:
- ClientConnectionHTTP
public class ClientConnection extends java.lang.Object implements SessionInterface
Base remote session proxy implementation. Uses instances of Result to transmit and recieve data. This implementation utilises the updated HSQL protocol.- Since:
- 1.7.2
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringNETWORK_COMPATIBILITY_VERSIONSpecifies the Compatibility version required for both Servers and network JDBC Clients built with this baseline.static intNETWORK_COMPATIBILITY_VERSION_INT-
Fields inherited from interface org.hsqldb.SessionInterface
INFO_AUTOCOMMIT, INFO_BOOLEAN, INFO_CATALOG, INFO_CONNECTION_READONLY, INFO_ID, INFO_INTEGER, INFO_ISOLATION, INFO_LIMIT, INFO_VARCHAR, lobStreamBlockSize, TX_READ_COMMITTED, TX_READ_UNCOMMITTED, TX_REPEATABLE_READ, TX_SERIALIZABLE
-
-
Constructor Summary
Constructors Constructor and Description ClientConnection(java.lang.String host, int port, java.lang.String path, java.lang.String database, boolean isTLS, boolean isTLSWrapper, java.lang.String user, java.lang.String password, int timeZoneSeconds)Establishes a connection to the server.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddWarning(HsqlException warning)voidallocateResultLob(ResultLob resultLob, java.io.InputStream dataInput)Does nothing herevoidclose()voidcloseNavigator(long navigatorId)voidcommit(boolean chain)BlobDataIDcreateBlob(long length)ClobDataIDcreateClob(long length)Resultexecute(Result r)java.lang.ObjectgetAttribute(int id)java.util.CalendargetCalendar()java.util.CalendargetCalendarGMT()HsqlPropertiesgetClientProperties()TimestampDatagetCurrentDate()java.lang.StringgetDatabaseUniqueName()longgetId()java.lang.StringgetInternalConnectionURL()Never called on this classintgetIsolation()JDBCConnectiongetJDBCConnection()longgetLobId()RowSetNavigatorClientgetRows(long navigatorId, int offset, int size)ScannergetScanner()SessiongetSession()java.text.SimpleDateFormatgetSimpleDateFormatGMT()intgetStreamBlockSize()intgetZoneSeconds()booleanisAutoCommit()booleanisClosed()booleanisReadOnlyDefault()voidprepareCommit()voidreleaseSavepoint(java.lang.String name)voidresetSession()Used by pooled connections to reset the server-side session to a new one.voidrollback(boolean chain)voidrollbackToSavepoint(java.lang.String name)voidsavepoint(java.lang.String name)voidsetAttribute(int id, java.lang.Object value)voidsetAutoCommit(boolean mode)voidsetIsolationDefault(int level)voidsetJDBCConnection(JDBCConnection connection)voidsetReadOnlyDefault(boolean mode)voidstartPhasedTransaction()static java.lang.StringtoNetCompVersionString(int i)Converts specified encoded integer to a Network Compatibility Version String.
-
-
-
Field Detail
-
NETWORK_COMPATIBILITY_VERSION
public static final java.lang.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.- See Also:
- Constant Field Values
-
NETWORK_COMPATIBILITY_VERSION_INT
public static final int NETWORK_COMPATIBILITY_VERSION_INT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClientConnection
public ClientConnection(java.lang.String host, int port, java.lang.String path, java.lang.String database, boolean isTLS, boolean isTLSWrapper, java.lang.String user, java.lang.String password, int timeZoneSeconds)Establishes a connection to the server.
-
-
Method Detail
-
execute
public Result execute(Result r)
- Specified by:
executein interfaceSessionInterface
-
getRows
public RowSetNavigatorClient getRows(long navigatorId, int offset, int size)
- Specified by:
getRowsin interfaceSessionInterface
-
closeNavigator
public void closeNavigator(long navigatorId)
- Specified by:
closeNavigatorin interfaceSessionInterface
-
close
public void close()
- Specified by:
closein interfaceSessionInterface
-
getAttribute
public java.lang.Object getAttribute(int id)
- Specified by:
getAttributein interfaceSessionInterface
-
setAttribute
public void setAttribute(int id, java.lang.Object value)- Specified by:
setAttributein interfaceSessionInterface
-
isReadOnlyDefault
public boolean isReadOnlyDefault()
- Specified by:
isReadOnlyDefaultin interfaceSessionInterface
-
setReadOnlyDefault
public void setReadOnlyDefault(boolean mode)
- Specified by:
setReadOnlyDefaultin interfaceSessionInterface
-
isAutoCommit
public boolean isAutoCommit()
- Specified by:
isAutoCommitin interfaceSessionInterface
-
setAutoCommit
public void setAutoCommit(boolean mode)
- Specified by:
setAutoCommitin interfaceSessionInterface
-
setIsolationDefault
public void setIsolationDefault(int level)
- Specified by:
setIsolationDefaultin interfaceSessionInterface
-
getIsolation
public int getIsolation()
- Specified by:
getIsolationin interfaceSessionInterface
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceSessionInterface
-
getSession
public Session getSession()
-
startPhasedTransaction
public void startPhasedTransaction()
- Specified by:
startPhasedTransactionin interfaceSessionInterface
-
prepareCommit
public void prepareCommit()
- Specified by:
prepareCommitin interfaceSessionInterface
-
commit
public void commit(boolean chain)
- Specified by:
commitin interfaceSessionInterface
-
rollback
public void rollback(boolean chain)
- Specified by:
rollbackin interfaceSessionInterface
-
rollbackToSavepoint
public void rollbackToSavepoint(java.lang.String name)
- Specified by:
rollbackToSavepointin interfaceSessionInterface
-
savepoint
public void savepoint(java.lang.String name)
- Specified by:
savepointin interfaceSessionInterface
-
releaseSavepoint
public void releaseSavepoint(java.lang.String name)
- Specified by:
releaseSavepointin interfaceSessionInterface
-
addWarning
public void addWarning(HsqlException warning)
- Specified by:
addWarningin interfaceSessionInterface
-
getId
public long getId()
- Specified by:
getIdin interfaceSessionInterface
-
resetSession
public void 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.- Specified by:
resetSessionin interfaceSessionInterface
-
getInternalConnectionURL
public java.lang.String getInternalConnectionURL()
Never called on this class- Specified by:
getInternalConnectionURLin interfaceSessionInterface
-
getLobId
public long getLobId()
-
createBlob
public BlobDataID createBlob(long length)
- Specified by:
createBlobin interfaceSessionInterface
-
createClob
public ClobDataID createClob(long length)
- Specified by:
createClobin interfaceSessionInterface
-
allocateResultLob
public void allocateResultLob(ResultLob resultLob, java.io.InputStream dataInput)
Does nothing here- Specified by:
allocateResultLobin interfaceSessionInterface
-
getScanner
public Scanner getScanner()
- Specified by:
getScannerin interfaceSessionInterface
-
getCalendar
public java.util.Calendar getCalendar()
- Specified by:
getCalendarin interfaceSessionInterface
-
getCalendarGMT
public java.util.Calendar getCalendarGMT()
- Specified by:
getCalendarGMTin interfaceSessionInterface
-
getSimpleDateFormatGMT
public java.text.SimpleDateFormat getSimpleDateFormatGMT()
- Specified by:
getSimpleDateFormatGMTin interfaceSessionInterface
-
getCurrentDate
public TimestampData getCurrentDate()
- Specified by:
getCurrentDatein interfaceSessionInterface
-
getZoneSeconds
public int getZoneSeconds()
- Specified by:
getZoneSecondsin interfaceSessionInterface
-
getStreamBlockSize
public int getStreamBlockSize()
- Specified by:
getStreamBlockSizein interfaceSessionInterface
-
getClientProperties
public HsqlProperties getClientProperties()
- Specified by:
getClientPropertiesin interfaceSessionInterface
-
getJDBCConnection
public JDBCConnection getJDBCConnection()
- Specified by:
getJDBCConnectionin interfaceSessionInterface
-
setJDBCConnection
public void setJDBCConnection(JDBCConnection connection)
- Specified by:
setJDBCConnectionin interfaceSessionInterface
-
getDatabaseUniqueName
public java.lang.String getDatabaseUniqueName()
- Specified by:
getDatabaseUniqueNamein interfaceSessionInterface
-
toNetCompVersionString
public static java.lang.String toNetCompVersionString(int i)
Converts specified encoded integer to a Network Compatibility Version String. The tranmitted integer is negative to distinguish it from 7 bit ASCII characters.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG