Package com.firebolt.jdbc.connection
Class FireboltConnection
java.lang.Object
com.firebolt.jdbc.JdbcBase
com.firebolt.jdbc.connection.FireboltConnection
- All Implemented Interfaces:
CacheListener
,GenericWrapper
,AutoCloseable
,Connection
,Wrapper
,EventListener
- Direct Known Subclasses:
FireboltConnectionServiceSecret
,FireboltConnectionUserPassword
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected int
protected final FireboltProperties
final ParserVersion
protected FireboltProperties
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FireboltConnection
(@NonNull String url, Properties connectionSettings, FireboltAuthenticationService fireboltAuthenticationService, FireboltStatementService fireboltStatementService, String protocolVersion, ParserVersion parserVersion) protected
FireboltConnection
(@NonNull String url, Properties connectionSettings, String protocolVersion, ParserVersion parserVersion) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addProperty
(@NonNull String key, String value) void
addProperty
(Map.Entry<String, String> property) protected abstract void
assertDatabaseExisting
(String database) protected abstract void
void
cleanup()
void
close()
void
commit()
protected void
connect()
static FireboltConnection
create
(@NonNull String url, Properties connectionSettings) createArrayOf
(String typeName, Object[] elements) protected abstract FireboltAuthenticationClient
createFireboltAuthenticationClient
(okhttp3.OkHttpClient httpClient) createStatement
(int resultSetType, int resultSetConcurrency) createStatement
(int resultSetType, int resultSetConcurrency, int resultSetHoldability) createStruct
(String typeName, Object[] attributes) protected FireboltProperties
extractFireboltProperties
(String jdbcUri, Properties connectionProperties) getAccessToken
(FireboltProperties fireboltProperties) boolean
getClientInfo
(String name) int
int
protected okhttp3.OkHttpClient
getHttpClient
(FireboltProperties fireboltProperties) int
int
int
boolean
isClosed()
boolean
boolean
isValid
(int timeout) prepareCall
(String sql) prepareCall
(String sql, int resultSetType, int resultSetConcurrency) prepareCall
(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement
(String sql) prepareStatement
(String sql, int autoGeneratedKeys) prepareStatement
(String sql, int[] columnIndexes) prepareStatement
(String sql, int resultSetType, int resultSetConcurrency) prepareStatement
(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement
(String sql, String[] columnNames) void
register
(CacheListener listener) void
releaseSavepoint
(Savepoint savepoint) void
removeClosedStatement
(FireboltStatement fireboltStatement) void
void
reset()
void
rollback()
void
void
setAutoCommit
(boolean autoCommit) void
setCatalog
(String catalog) void
setClientInfo
(String name, String value) void
setClientInfo
(Properties properties) void
setEndpoint
(String endpoint) void
setHoldability
(int holdability) void
setNetworkTimeout
(Executor executor, int milliseconds) void
setReadOnly
(boolean readOnly) setSavepoint
(String name) void
void
setTransactionIsolation
(int level) void
setTypeMap
(Map<String, Class<?>> map) Methods inherited from class com.firebolt.jdbc.JdbcBase
addWarning, clearWarnings, getWarnings
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.Connection
beginRequest, clearWarnings, endRequest, getWarnings, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
Methods inherited from interface com.firebolt.jdbc.GenericWrapper
isWrapperFor, unwrap
-
Field Details
-
httpConnectionUrl
-
sessionProperties
-
infraVersion
protected int infraVersion -
loginProperties
-
parserVersion
-
-
Constructor Details
-
FireboltConnection
protected FireboltConnection(@NonNull @NonNull String url, Properties connectionSettings, FireboltAuthenticationService fireboltAuthenticationService, FireboltStatementService fireboltStatementService, String protocolVersion, ParserVersion parserVersion) -
FireboltConnection
protected FireboltConnection(@NonNull @NonNull String url, Properties connectionSettings, String protocolVersion, ParserVersion parserVersion) throws SQLException - Throws:
SQLException
-
-
Method Details
-
createFireboltAuthenticationClient
protected abstract FireboltAuthenticationClient createFireboltAuthenticationClient(okhttp3.OkHttpClient httpClient) -
create
public static FireboltConnection create(@NonNull @NonNull String url, Properties connectionSettings) throws SQLException - Throws:
SQLException
-
getHttpClient
protected okhttp3.OkHttpClient getHttpClient(FireboltProperties fireboltProperties) throws SQLException - Throws:
SQLException
-
connect
- Throws:
SQLException
-
authenticate
- Throws:
SQLException
-
assertDatabaseExisting
- Throws:
SQLException
-
removeExpiredTokens
- Throws:
SQLException
-
getAccessToken
- Throws:
SQLException
-
getAccessToken
protected Optional<String> getAccessToken(FireboltProperties fireboltProperties) throws SQLException - Throws:
SQLException
-
getSessionProperties
-
createStatement
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
getAutoCommit
- Specified by:
getAutoCommit
in interfaceConnection
- Throws:
SQLException
-
setAutoCommit
- Specified by:
setAutoCommit
in interfaceConnection
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceConnection
-
getMetaData
- Specified by:
getMetaData
in interfaceConnection
- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalog
in interfaceConnection
- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalog
in interfaceConnection
-
getEngine
-
getTransactionIsolation
- Specified by:
getTransactionIsolation
in interfaceConnection
- Throws:
SQLException
-
setTransactionIsolation
- Specified by:
setTransactionIsolation
in interfaceConnection
- Throws:
SQLException
-
createStatement
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
getSchema
- Specified by:
getSchema
in interfaceConnection
- Throws:
SQLException
-
setSchema
- Specified by:
setSchema
in interfaceConnection
-
abort
- Specified by:
abort
in interfaceConnection
- Throws:
SQLException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnection
-
extractFireboltProperties
protected FireboltProperties extractFireboltProperties(String jdbcUri, Properties connectionProperties) -
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
isValid
- Specified by:
isValid
in interfaceConnection
- Throws:
SQLException
-
removeClosedStatement
-
addProperty
- Throws:
SQLException
-
addProperty
- Throws:
SQLException
-
reset
- Throws:
SQLException
-
setEndpoint
-
getEndpoint
-
commit
- Specified by:
commit
in interfaceConnection
-
rollback
- Specified by:
rollback
in interfaceConnection
- Throws:
SQLException
-
setNetworkTimeout
- Specified by:
setNetworkTimeout
in interfaceConnection
- Throws:
SQLException
-
getNetworkTimeout
public int getNetworkTimeout()- Specified by:
getNetworkTimeout
in interfaceConnection
-
getConnectionTimeout
public int getConnectionTimeout() -
nativeSQL
- Specified by:
nativeSQL
in interfaceConnection
- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnly
in interfaceConnection
- Throws:
SQLException
-
setReadOnly
- Specified by:
setReadOnly
in interfaceConnection
-
prepareCall
@NotImplemented public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMap
in interfaceConnection
-
setTypeMap
- Specified by:
setTypeMap
in interfaceConnection
- Throws:
SQLException
-
getHoldability
- Specified by:
getHoldability
in interfaceConnection
- Throws:
SQLException
-
setHoldability
- Specified by:
setHoldability
in interfaceConnection
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
rollback
- Specified by:
rollback
in interfaceConnection
- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepoint
in interfaceConnection
- Throws:
SQLException
-
prepareCall
@NotImplemented public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
createClob
- Specified by:
createClob
in interfaceConnection
-
createBlob
- Specified by:
createBlob
in interfaceConnection
-
createNClob
- Specified by:
createNClob
in interfaceConnection
-
createSQLXML
- Specified by:
createSQLXML
in interfaceConnection
- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Throws:
SQLClientInfoException
-
getClientInfo
- Specified by:
getClientInfo
in interfaceConnection
-
getClientInfo
- Specified by:
getClientInfo
in interfaceConnection
- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Throws:
SQLClientInfoException
-
createArrayOf
- Specified by:
createArrayOf
in interfaceConnection
- Throws:
SQLException
-
createStruct
@NotImplemented public Struct createStruct(String typeName, Object[] attributes) throws SQLException - Specified by:
createStruct
in interfaceConnection
- Throws:
SQLException
-
getProtocolVersion
-
getInfraVersion
public int getInfraVersion() -
register
-
cleanup
public void cleanup()- Specified by:
cleanup
in interfaceCacheListener
-