Class DataCloudConnection
- java.lang.Object
-
- com.salesforce.datacloud.jdbc.core.DataCloudConnection
-
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper
public class DataCloudConnection extends Object implements Connection, AutoCloseable
-
-
Field Summary
-
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort(Executor executor)static booleanacceptsUrl(String url)voidclearWarnings()voidclose()voidcommit()ArraycreateArrayOf(String typeName, Object[] elements)BlobcreateBlob()ClobcreateClob()NClobcreateNClob()SQLXMLcreateSQLXML()StatementcreateStatement()StatementcreateStatement(int resultSetType, int resultSetConcurrency)StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)StructcreateStruct(String typeName, Object[] attributes)static DataCloudConnectionfromChannel(@NonNull io.grpc.ManagedChannelBuilder<?> builder, Properties properties)static DataCloudConnectionfromTokenSupplier(AuthorizationHeaderInterceptor authInterceptor, @NonNull String host, int port, Properties properties)This flow is not supported by the JDBC Driver Manager, only use it if you know what you're doing.static DataCloudConnectionfromTokenSupplier(AuthorizationHeaderInterceptor authInterceptor, io.grpc.ManagedChannelBuilder<?> builder, Properties properties)This flow is not supported by the JDBC Driver Manager, only use it if you know what you're doing.booleangetAutoCommit()StringgetCatalog()PropertiesgetClientInfo()StringgetClientInfo(String name)AtomicBooleangetClosed()@NonNull HyperGrpcClientExecutorgetExecutor()intgetHoldability()List<io.grpc.ClientInterceptor>getInterceptors()DatabaseMetaDatagetMetaData()intgetNetworkTimeout()@NonNull PropertiesgetProperties()StringgetSchema()TokenProcessorgetTokenProcessor()intgetTransactionIsolation()Map<String,Class<?>>getTypeMap()SQLWarninggetWarnings()booleanisClosed()booleanisReadOnly()booleanisValid(int timeout)booleanisWrapperFor(Class<?> iface)StringnativeSQL(String sql)static DataCloudConnectionof(String url, Properties properties)CallableStatementprepareCall(String sql)CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)PreparedStatementprepareStatement(String sql)PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)PreparedStatementprepareStatement(String sql, int[] columnIndexes)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)PreparedStatementprepareStatement(String sql, String[] columnNames)voidreleaseSavepoint(Savepoint savepoint)voidrollback()voidrollback(Savepoint savepoint)voidsetAutoCommit(boolean autoCommit)voidsetCatalog(String catalog)voidsetClientInfo(String name, String value)voidsetClientInfo(Properties properties)voidsetHoldability(int holdability)voidsetInterceptors(List<io.grpc.ClientInterceptor> interceptors)voidsetNetworkTimeout(Executor executor, int milliseconds)voidsetReadOnly(boolean readOnly)SavepointsetSavepoint()SavepointsetSavepoint(String name)voidsetSchema(String schema)voidsetTransactionIsolation(int level)voidsetTypeMap(Map<String,Class<?>> map)<T> Tunwrap(Class<T> iface)-
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, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
-
-
-
Method Detail
-
fromChannel
public static DataCloudConnection fromChannel(@NonNull @NonNull io.grpc.ManagedChannelBuilder<?> builder, Properties properties) throws SQLException
- Throws:
SQLException
-
fromTokenSupplier
public static DataCloudConnection fromTokenSupplier(AuthorizationHeaderInterceptor authInterceptor, @NonNull @NonNull String host, int port, Properties properties) throws SQLException
This flow is not supported by the JDBC Driver Manager, only use it if you know what you're doing.- Throws:
SQLException
-
fromTokenSupplier
public static DataCloudConnection fromTokenSupplier(AuthorizationHeaderInterceptor authInterceptor, io.grpc.ManagedChannelBuilder<?> builder, Properties properties) throws SQLException
This flow is not supported by the JDBC Driver Manager, only use it if you know what you're doing.- Throws:
SQLException
-
of
public static DataCloudConnection of(String url, Properties properties) throws SQLException
- Throws:
SQLException
-
createStatement
public Statement createStatement()
- Specified by:
createStatementin interfaceConnection
-
prepareStatement
public PreparedStatement prepareStatement(String sql)
- Specified by:
prepareStatementin interfaceConnection
-
prepareCall
public CallableStatement prepareCall(String sql)
- Specified by:
prepareCallin interfaceConnection
-
nativeSQL
public String nativeSQL(String sql)
- Specified by:
nativeSQLin interfaceConnection
-
setAutoCommit
public void setAutoCommit(boolean autoCommit)
- Specified by:
setAutoCommitin interfaceConnection
-
getAutoCommit
public boolean getAutoCommit()
- Specified by:
getAutoCommitin interfaceConnection
-
commit
public void commit()
- Specified by:
commitin interfaceConnection
-
rollback
public void rollback()
- Specified by:
rollbackin interfaceConnection
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceConnection
-
getMetaData
public DatabaseMetaData getMetaData()
- Specified by:
getMetaDatain interfaceConnection
-
setReadOnly
public void setReadOnly(boolean readOnly)
- Specified by:
setReadOnlyin interfaceConnection
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceConnection
-
setCatalog
public void setCatalog(String catalog)
- Specified by:
setCatalogin interfaceConnection
-
getCatalog
public String getCatalog()
- Specified by:
getCatalogin interfaceConnection
-
setTransactionIsolation
public void setTransactionIsolation(int level)
- Specified by:
setTransactionIsolationin interfaceConnection
-
getTransactionIsolation
public int getTransactionIsolation()
- Specified by:
getTransactionIsolationin interfaceConnection
-
getWarnings
public SQLWarning getWarnings()
- Specified by:
getWarningsin interfaceConnection
-
clearWarnings
public void clearWarnings()
- Specified by:
clearWarningsin interfaceConnection
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency)
- Specified by:
createStatementin interfaceConnection
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
- Specified by:
prepareStatementin interfaceConnection
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
- Specified by:
prepareCallin interfaceConnection
-
getTypeMap
public Map<String,Class<?>> getTypeMap()
- Specified by:
getTypeMapin interfaceConnection
-
setTypeMap
public void setTypeMap(Map<String,Class<?>> map)
- Specified by:
setTypeMapin interfaceConnection
-
setHoldability
public void setHoldability(int holdability)
- Specified by:
setHoldabilityin interfaceConnection
-
getHoldability
public int getHoldability()
- Specified by:
getHoldabilityin interfaceConnection
-
setSavepoint
public Savepoint setSavepoint()
- Specified by:
setSavepointin interfaceConnection
-
setSavepoint
public Savepoint setSavepoint(String name)
- Specified by:
setSavepointin interfaceConnection
-
rollback
public void rollback(Savepoint savepoint)
- Specified by:
rollbackin interfaceConnection
-
releaseSavepoint
public void releaseSavepoint(Savepoint savepoint)
- Specified by:
releaseSavepointin interfaceConnection
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
- Specified by:
createStatementin interfaceConnection
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
- Specified by:
prepareStatementin interfaceConnection
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
- Specified by:
prepareCallin interfaceConnection
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
- Specified by:
prepareStatementin interfaceConnection
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int[] columnIndexes)
- Specified by:
prepareStatementin interfaceConnection
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames)
- Specified by:
prepareStatementin interfaceConnection
-
createClob
public Clob createClob()
- Specified by:
createClobin interfaceConnection
-
createBlob
public Blob createBlob()
- Specified by:
createBlobin interfaceConnection
-
createNClob
public NClob createNClob()
- Specified by:
createNClobin interfaceConnection
-
createSQLXML
public SQLXML createSQLXML()
- Specified by:
createSQLXMLin interfaceConnection
-
isValid
public boolean isValid(int timeout) throws SQLException- Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
setClientInfo
public void setClientInfo(String name, String value)
- Specified by:
setClientInfoin interfaceConnection
-
setClientInfo
public void setClientInfo(Properties properties)
- Specified by:
setClientInfoin interfaceConnection
-
getClientInfo
public String getClientInfo(String name)
- Specified by:
getClientInfoin interfaceConnection
-
getClientInfo
public Properties getClientInfo()
- Specified by:
getClientInfoin interfaceConnection
-
createArrayOf
public Array createArrayOf(String typeName, Object[] elements)
- Specified by:
createArrayOfin interfaceConnection
-
createStruct
public Struct createStruct(String typeName, Object[] attributes)
- Specified by:
createStructin interfaceConnection
-
setSchema
public void setSchema(String schema)
- Specified by:
setSchemain interfaceConnection
-
getSchema
public String getSchema()
- Specified by:
getSchemain interfaceConnection
-
abort
public void abort(Executor executor)
- Specified by:
abortin interfaceConnection
-
setNetworkTimeout
public void setNetworkTimeout(Executor executor, int milliseconds)
- Specified by:
setNetworkTimeoutin interfaceConnection
-
getNetworkTimeout
public int getNetworkTimeout()
- Specified by:
getNetworkTimeoutin interfaceConnection
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
- Specified by:
isWrapperForin interfaceWrapper
-
acceptsUrl
public static boolean acceptsUrl(String url)
-
getClosed
public AtomicBoolean getClosed()
-
getTokenProcessor
public TokenProcessor getTokenProcessor()
-
getProperties
@NonNull public @NonNull Properties getProperties()
-
getInterceptors
public List<io.grpc.ClientInterceptor> getInterceptors()
-
getExecutor
@NonNull public @NonNull HyperGrpcClientExecutor getExecutor()
-
setInterceptors
public void setInterceptors(List<io.grpc.ClientInterceptor> interceptors)
-
-