public class CloudSpannerConnection extends AbstractCloudSpannerConnection
| Modifier and Type | Class and Description |
|---|---|
static class |
CloudSpannerConnection.CloudSpannerDatabaseSpecification |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Modifier and Type | Method and Description |
|---|---|
int |
clearFinishedDDLOperations()
Clears the asynchronous DDL-operations that have finished.
|
void |
close() |
void |
commit() |
void |
commitPreparedTransaction(String xid)
Commit a previously prepared transaction.
|
CloudSpannerArray |
createArrayOf(String typeName,
Object[] elements) |
CloudSpannerConnection |
createCopyConnection() |
CloudSpannerStatement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Void |
executeDDL(List<String> sql)
Execute one or more DDL-statements on the database and wait for it to
finish or return after syntax check (when running in async mode).
|
boolean |
getAutoCommit() |
String |
getClientId() |
static com.google.auth.oauth2.GoogleCredentials |
getCredentialsFromFile(String credentialsPath) |
static com.google.auth.oauth2.GoogleCredentials |
getCredentialsFromOAuthToken(String oauthToken) |
ResultSet |
getDynamicConnectionProperties(Statement statement) |
ResultSet |
getDynamicConnectionProperty(Statement statement,
String propertyName) |
com.google.cloud.Timestamp |
getLastCommitTimestamp() |
Logger |
getLogger() |
CloudSpannerDatabaseMetaData |
getMetaData() |
int |
getNodeCount() |
String |
getProductName() |
ResultSet |
getRunningDDLOperations(Statement statement)
Returns a ResultSet containing all asynchronous DDL-operations started by
this connection.
|
static String |
getServiceAccountProjectId(String credentialsPath) |
Integer |
getSimulateMajorVersion() |
Integer |
getSimulateMinorVersion() |
String |
getSimulateProductName() |
Properties |
getSuppliedProperties() |
MetaDataStore.TableKeyMetaData |
getTable(String name) |
CloudSpannerTransaction |
getTransaction() |
int |
getTransactionIsolation() |
Map<String,Class<?>> |
getTypeMap() |
String |
getUrl() |
boolean |
isAllowExtendedMode() |
boolean |
isAsyncDdlOperations() |
boolean |
isClosed() |
boolean |
isReadOnly() |
boolean |
isValid(int timeout) |
String |
nativeSQL(String sql) |
CallableStatement |
prepareCall(String sql) |
CloudSpannerPreparedStatement |
prepareStatement(String sql) |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys) |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames) |
void |
prepareTransaction(String xid)
Prepare the current transaction by writing the mutations to the
XA_TRANSACTIONS table instead of persisting them in the actual tables.
|
void |
rollback() |
void |
rollbackPreparedTransaction(String xid)
Rollback a previously prepared transaction.
|
void |
setAllowExtendedMode(boolean allowExtendedMode) |
void |
setAsyncDdlOperations(boolean asyncDdlOperations) |
void |
setAutoCommit(boolean autoCommit) |
int |
setDynamicConnectionProperty(String propertyName,
String propertyValue) |
void |
setReadOnly(boolean readOnly) |
void |
setSimulateMajorVersion(Integer majorVersion) |
void |
setSimulateMinorVersion(Integer minorVersion) |
void |
setSimulateProductName(String productName) |
void |
setTransactionIsolation(int level) |
void |
setTypeMap(Map<String,Class<?>> map) |
void |
waitForDdlOperations()
Waits for all asynchronous DDL-operations that have been issued by this
connection to finish.
|
abort, checkClosed, clearWarnings, createBlob, createClob, createNClob, createSQLXML, createStruct, getCatalog, getClientInfo, getClientInfo, getHoldability, getNetworkTimeout, getSchema, getWarnings, prepareCall, prepareCall, releaseSavepoint, rollback, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setSavepoint, setSavepoint, setSchemaextractColumnType, getClassName, getGoogleTypeName, isWrapperFor, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisWrapperFor, unwrappublic static com.google.auth.oauth2.GoogleCredentials getCredentialsFromOAuthToken(String oauthToken)
public static com.google.auth.oauth2.GoogleCredentials getCredentialsFromFile(String credentialsPath) throws IOException
IOExceptionpublic String getSimulateProductName()
public void setSimulateProductName(String productName)
public Integer getSimulateMajorVersion()
public void setSimulateMajorVersion(Integer majorVersion)
public Integer getSimulateMinorVersion()
public void setSimulateMinorVersion(Integer minorVersion)
public Void executeDDL(List<String> sql) throws SQLException
sql - The DDL-statement(s) to executeSQLException - If an error occurs during the execution of the statement.public int clearFinishedDDLOperations()
public void waitForDdlOperations()
throws SQLException
SQLException - If a database exception occurs while waiting for the
operations to finishpublic ResultSet getRunningDDLOperations(Statement statement)
statement - The statement that requested the operationspublic String getProductName()
public CloudSpannerStatement createStatement() throws SQLException
SQLExceptionpublic CloudSpannerPreparedStatement prepareStatement(String sql) throws SQLException
SQLExceptionpublic CallableStatement prepareCall(String sql) throws SQLException
SQLExceptionpublic String nativeSQL(String sql) throws SQLException
SQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws SQLException
SQLExceptionpublic boolean getAutoCommit()
throws SQLException
SQLExceptionpublic void commit()
throws SQLException
SQLExceptionpublic void rollback()
throws SQLException
SQLExceptionpublic CloudSpannerTransaction getTransaction()
public void close()
throws SQLException
SQLExceptionpublic boolean isClosed()
throws SQLException
SQLExceptionpublic CloudSpannerDatabaseMetaData getMetaData() throws SQLException
SQLExceptionpublic void setReadOnly(boolean readOnly)
throws SQLException
SQLExceptionpublic boolean isReadOnly()
throws SQLException
SQLExceptionpublic void setTransactionIsolation(int level)
throws SQLException
SQLExceptionpublic int getTransactionIsolation()
throws SQLException
SQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
SQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
SQLExceptionpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
SQLExceptionpublic String getUrl()
public String getClientId()
public boolean isValid(int timeout)
throws SQLException
SQLExceptionpublic CloudSpannerArray createArrayOf(String typeName, Object[] elements) throws SQLException
SQLExceptionpublic MetaDataStore.TableKeyMetaData getTable(String name) throws SQLException
SQLExceptionpublic Properties getSuppliedProperties()
public boolean isAllowExtendedMode()
public void setAllowExtendedMode(boolean allowExtendedMode)
public boolean isAsyncDdlOperations()
public void setAsyncDdlOperations(boolean asyncDdlOperations)
public int setDynamicConnectionProperty(String propertyName, String propertyValue)
public ResultSet getDynamicConnectionProperty(Statement statement, String propertyName)
public com.google.cloud.Timestamp getLastCommitTimestamp()
public CloudSpannerConnection createCopyConnection() throws SQLException
SQLException - If an error occurs while opening the new connectionpublic Logger getLogger()
public Map<String,Class<?>> getTypeMap() throws SQLException
SQLExceptionpublic void setTypeMap(Map<String,Class<?>> map) throws SQLException
SQLExceptionpublic int getNodeCount()
throws SQLException
SQLException - If an exception occurs when trying to get the number of nodespublic void prepareTransaction(String xid) throws SQLException
xid - The id of the prepared transactionSQLException - If an exception occurs while saving the mutations to the
database for later commitpublic void commitPreparedTransaction(String xid) throws SQLException
xid - The id of the prepared transactionSQLException - If an error occurs when writing the mutations to the databasepublic void rollbackPreparedTransaction(String xid) throws SQLException
xid - The id of the prepared transaction to rollbackSQLException - If an error occurs while rolling back the prepared
transactionCopyright © 2017. All rights reserved.