public class BaseContext extends Object implements com.singlestore.jdbc.client.Context
| Modifier and Type | Field and Description |
|---|---|
protected int |
serverStatus
Server status context
|
| Constructor and Description |
|---|
BaseContext(HostAddress hostAddress,
InitialHandshakePacket handshake,
long clientCapabilities,
Configuration conf,
ExceptionFactory exceptionFactory,
com.singlestore.jdbc.client.PrepareCache prepareCache)
Constructor of connection context
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStateFlag(int state)
Indicate connection state (for pooling)
|
boolean |
canSkipMeta()
Can server skip prepared statement metadata
|
String |
getCharset()
Retrieve current charset if session state get it
|
Function<com.singlestore.jdbc.client.ReadableByteBuf,com.singlestore.jdbc.client.ColumnDecoder> |
getColumnDecoderFunction()
Column decoder function
|
Configuration |
getConf()
Get connection configuration
|
String |
getDatabase()
Get current connection database
|
ExceptionFactory |
getExceptionFactory()
Get connection exception factory
|
Prepare |
getPrepareCacheCmd(String sql,
BasePreparedStatement preparedStatement)
Return cached prepare if key match
|
byte[] |
getSeed()
Get connection initial seed
|
long |
getServerCapabilities() |
int |
getServerStatus()
Get server connection state
|
int |
getStateFlag()
return connection current state change flag
|
long |
getThreadId()
return current thread id
|
Integer |
getTransactionIsolationLevel()
Get connection transaction isolation level
|
int |
getWarning()
has server warnings
|
boolean |
hasClientCapability(long flag)
has client capability
|
boolean |
hasServerCapability(long flag)
has server capability
|
boolean |
isEofDeprecated()
does protocol remove EOF in exchanges
|
boolean |
permitPipeline()
Does server and client permit pipeline
|
Prepare |
putPrepareCacheCmd(String sql,
Prepare result,
BasePreparedStatement preparedStatement)
Put prepare result in cache
|
void |
resetPrepareCache()
Reset prepare cache (after a failover)
|
void |
resetStateFlag()
reset connection state change flag
|
void |
setCharset(String charset)
Indicate server charset change
|
void |
setDatabase(String database)
set current database context
|
void |
setServerStatus(int serverStatus)
Set server connection state
|
void |
setThreadId(long connectionId)
Indicate server connection Id (not truncated)
|
void |
setTransactionIsolationLevel(int transactionIsolationLevel)
Set current connection transaction isolation level
|
void |
setTreadsConnected(long threadsConnected)
Indicate the number of connection on this server.
|
void |
setWarning(int warning)
set server state warning number
|
public BaseContext(HostAddress hostAddress, InitialHandshakePacket handshake, long clientCapabilities, Configuration conf, ExceptionFactory exceptionFactory, com.singlestore.jdbc.client.PrepareCache prepareCache)
hostAddress - host addresshandshake - server handshakeclientCapabilities - client capabilitiesconf - connection configurationexceptionFactory - connection exception factoryprepareCache - LRU prepare cachepublic long getThreadId()
com.singlestore.jdbc.client.ContextgetThreadId in interface com.singlestore.jdbc.client.Contextpublic void setThreadId(long connectionId)
com.singlestore.jdbc.client.ContextsetThreadId in interface com.singlestore.jdbc.client.ContextconnectionId - connection idpublic byte[] getSeed()
com.singlestore.jdbc.client.ContextgetSeed in interface com.singlestore.jdbc.client.Contextpublic boolean hasServerCapability(long flag)
com.singlestore.jdbc.client.ContexthasServerCapability in interface com.singlestore.jdbc.client.Contextflag - capability to checkpublic boolean hasClientCapability(long flag)
com.singlestore.jdbc.client.ContexthasClientCapability in interface com.singlestore.jdbc.client.Contextflag - capability to checkpublic boolean permitPipeline()
com.singlestore.jdbc.client.ContextpermitPipeline in interface com.singlestore.jdbc.client.Contextpublic long getServerCapabilities()
getServerCapabilities in interface com.singlestore.jdbc.client.Contextpublic int getServerStatus()
com.singlestore.jdbc.client.ContextgetServerStatus in interface com.singlestore.jdbc.client.Contextpublic void setServerStatus(int serverStatus)
com.singlestore.jdbc.client.ContextsetServerStatus in interface com.singlestore.jdbc.client.ContextserverStatus - server statuspublic String getDatabase()
com.singlestore.jdbc.client.ContextgetDatabase in interface com.singlestore.jdbc.client.Contextpublic void setDatabase(String database)
com.singlestore.jdbc.client.ContextsetDatabase in interface com.singlestore.jdbc.client.Contextdatabase - databasepublic boolean isEofDeprecated()
com.singlestore.jdbc.client.ContextisEofDeprecated in interface com.singlestore.jdbc.client.Contextpublic boolean canSkipMeta()
com.singlestore.jdbc.client.ContextcanSkipMeta in interface com.singlestore.jdbc.client.Contextpublic Function<com.singlestore.jdbc.client.ReadableByteBuf,com.singlestore.jdbc.client.ColumnDecoder> getColumnDecoderFunction()
com.singlestore.jdbc.client.ContextgetColumnDecoderFunction in interface com.singlestore.jdbc.client.Contextpublic int getWarning()
com.singlestore.jdbc.client.ContextgetWarning in interface com.singlestore.jdbc.client.Contextpublic void setWarning(int warning)
com.singlestore.jdbc.client.ContextsetWarning in interface com.singlestore.jdbc.client.Contextwarning - warning numberpublic ExceptionFactory getExceptionFactory()
com.singlestore.jdbc.client.ContextgetExceptionFactory in interface com.singlestore.jdbc.client.Contextpublic Configuration getConf()
com.singlestore.jdbc.client.ContextgetConf in interface com.singlestore.jdbc.client.Contextpublic Integer getTransactionIsolationLevel()
com.singlestore.jdbc.client.ContextgetTransactionIsolationLevel in interface com.singlestore.jdbc.client.Contextpublic void setTransactionIsolationLevel(int transactionIsolationLevel)
com.singlestore.jdbc.client.ContextsetTransactionIsolationLevel in interface com.singlestore.jdbc.client.ContexttransactionIsolationLevel - new connection transaction isolation levelpublic Prepare getPrepareCacheCmd(String sql, BasePreparedStatement preparedStatement)
com.singlestore.jdbc.client.ContextgetPrepareCacheCmd in interface com.singlestore.jdbc.client.Contextsql - sql commandpreparedStatement - current statementpublic Prepare putPrepareCacheCmd(String sql, Prepare result, BasePreparedStatement preparedStatement)
com.singlestore.jdbc.client.ContextputPrepareCacheCmd in interface com.singlestore.jdbc.client.Contextsql - sql commandresult - prepare resultpreparedStatement - current statementpublic void resetPrepareCache()
com.singlestore.jdbc.client.ContextresetPrepareCache in interface com.singlestore.jdbc.client.Contextpublic int getStateFlag()
com.singlestore.jdbc.client.ContextgetStateFlag in interface com.singlestore.jdbc.client.Contextpublic void resetStateFlag()
com.singlestore.jdbc.client.ContextresetStateFlag in interface com.singlestore.jdbc.client.Contextpublic void addStateFlag(int state)
com.singlestore.jdbc.client.ContextaddStateFlag in interface com.singlestore.jdbc.client.Contextstate - indicate that some connection state has changedpublic void setTreadsConnected(long threadsConnected)
com.singlestore.jdbc.client.ContextsetTreadsConnected in interface com.singlestore.jdbc.client.ContextthreadsConnected - number of threadspublic String getCharset()
com.singlestore.jdbc.client.ContextgetCharset in interface com.singlestore.jdbc.client.Contextpublic void setCharset(String charset)
com.singlestore.jdbc.client.ContextsetCharset in interface com.singlestore.jdbc.client.Contextcharset - server charsetCopyright © 2025 SingleStore. All rights reserved.