Package com.ocient.jdbc
Class XGConnection
java.lang.Object
com.ocient.jdbc.XGConnection
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper
public class XGConnection extends Object implements Connection
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXGConnection.ConnectionPropertystatic classXGConnection.ConnectionPropertyGroupstatic classXGConnection.HandshakeTypestatic classXGConnection.Tls -
Field Summary
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
Constructors Constructor Description XGConnection(String user, String pwd, String ip, int portNum, String url, String database, String protocolVersion, String clientVersion, String force, XGConnection.Tls tls, Properties properties) -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Field Details
-
USER_HOME_PATH
-
OKTA_NATIVE_SSO_TOKEN_FILE_NAME
- See Also:
- Constant Field Values
-
OKTA_NATIVE_SSO_TOKEN_FILE_PATH
-
in
-
out
-
rs
-
portNum
protected int portNum -
warnings
-
url
-
ip
-
originalIp
-
connectedIp
-
originalPort
protected int originalPort -
connectedPort
protected int connectedPort -
user
-
database
-
client
-
protocolVersion
-
clientVersion
-
serverVersion
-
defaultSchema
-
oneShotForce
protected boolean oneShotForce -
cmdcomps
-
secondaryInterfaces
-
secondaryIndex
protected int secondaryIndex -
networkTimeout
protected int networkTimeout -
tls
-
sessionID
-
metricsEnabled
protected static volatile boolean metricsEnabled -
pwd
-
session
protected com.ocient.jdbc.XGConnection.Session session -
serverSessionId
-
sessionState
protected com.ocient.jdbc.XGConnection.Session.State sessionState -
typeMap
-
setSchema
-
setPso
protected long setPso -
maxRows
-
force
protected boolean force
-
-
Constructor Details
-
XGConnection
public XGConnection(String user, String pwd, String ip, int portNum, String url, String database, String protocolVersion, String clientVersion, String force, XGConnection.Tls tls, Properties properties) throws Exception- Throws:
Exception
-
-
Method Details
-
refreshSession
- Throws:
SQLException
-
refreshToken
- Throws:
SQLException
-
abort
- Specified by:
abortin interfaceConnection- Throws:
SQLException
-
addTimeout
Schedules the task to run after the specified delay- Parameters:
task- the task to runtimeout- delay in milliseconds
-
setMetrics
public static void setMetrics(boolean enabled) -
clearOneShotForce
public void clearOneShotForce() -
clearWarnings
- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
getDefaultOAuthFlow
-
resolveOktaNativeSSOTokenFilePath
-
readOktaNativeSSOToken
public static Optional<OktaAuthenticators.OktaNativeSSOToken> readOktaNativeSSOToken(Path tokenFilePath) throws Exception- Throws:
Exception
-
createOktaNativeSSOToken
public static OktaAuthenticators.OktaNativeSSOToken createOktaNativeSSOToken(ClientWireProtocol.OpenIDAuthenticator authenticator, Properties properties) throws Exception- Throws:
Exception
-
writeOktaNativeSSOToken
public static void writeOktaNativeSSOToken(Path tokenFilePath, OktaAuthenticators.OktaNativeSSOToken token) throws Exception- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException
-
commit
- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
connect
- Throws:
Exception
-
connected
public boolean connected() -
copy
- Throws:
SQLException
-
copy
- Throws:
SQLException
-
copy
- Throws:
SQLException
-
createArrayOf
- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException
-
createBlob
- Specified by:
createBlobin interfaceConnection- Throws:
SQLException
-
createClob
- Specified by:
createClobin interfaceConnection- Throws:
SQLException
-
createNClob
- Specified by:
createNClobin interfaceConnection- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStruct
- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
fetchAuthenticators
Fetches allClientWireProtocol.Authenticators- Returns:
- Throws:
SQLException
-
forceExternal
- Throws:
SQLException
-
getAutoCommit
- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getDB
-
getProperties
-
getHoldability
- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
getMajorVersion
public int getMajorVersion() -
getMetaData
- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException
-
getMinorVersion
public int getMinorVersion() -
getNetworkTimeout
- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
getSchema
- Specified by:
getSchemain interfaceConnection- Throws:
SQLException
-
getSchemaLocal
-
setSchemaLocal
-
getServerVersion
-
getTimeoutMillis
protected long getTimeoutMillis() -
getTransactionIsolation
- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
getURL
-
getUser
-
getVersion
-
getWarnings
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
equals
Equals and hashcode should almost always be autogenerated. Only roll your own if 1. have a legitimate reason to do so (very rare) 2. know what you're doing 3. write unit tests for object equality -
hashCode
public int hashCode() -
isClosed
- Specified by:
isClosedin interfaceConnection- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
isValid
- Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
nativeSQL
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
purgeTimeoutTasks
protected void purgeTimeoutTasks()Purges all canceled tasks from the timer.Note: You should only call this if you've canceled a timer. This call may create a
Timerobject if one does not already exist -
reconnect
- Throws:
IOExceptionSQLException
-
reconnect
- Throws:
IOExceptionSQLException
-
redirect
public void redirect(String host, int port, boolean shouldRequestVersion) throws IOException, SQLException- Throws:
IOExceptionSQLException
-
releaseSavepoint
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
sendParameterMessage
- Throws:
SQLException
-
setAutoCommit
- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setParallelism
- Throws:
SQLException
-
setHoldability
- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
setMaxRows
-
setMaxRowsHardLimit
- Throws:
SQLException
-
setMaxTempDisk
- Throws:
SQLException
-
setMaxTime
- Throws:
SQLException
-
setNetworkTimeout
- Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
setPriority
- Throws:
SQLException
-
setPSOSeed
- Throws:
Exception
-
setPSO
- Throws:
Exception
-
setPSO
- Throws:
Exception
-
setPriorityAdjustFactor
- Throws:
SQLException
-
setPriorityAdjustTime
- Throws:
SQLException
-
setReadOnly
- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSchema
- Specified by:
setSchemain interfaceConnection- Throws:
SQLException
-
setServerVersion
-
setTimeout
- Throws:
SQLException
-
setTransactionIsolation
- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
sendRefreshSession
- Throws:
SQLException
-
sendRefreshToken
public com.ocient.jdbc.XGConnection.Session.State sendRefreshToken(com.ocient.jdbc.XGConnection.Session.State oldState) throws SQLException- Throws:
SQLException
-