20230628 java.sql.Connection
介绍
- java.sql.Connection
- public interface Connection extends Wrapper, AutoCloseable
API
常量
TransactionIsolation
- TRANSACTION_NONE : 0
- TRANSACTION_READ_UNCOMMITTED : 1
- TRANSACTION_READ_COMMITTED : 2
- TRANSACTION_REPEATABLE_READ : 4
- TRANSACTION_SERIALIZABLE : 8
public
-
setSavepoint
- 设置一个匿名或具名的保存点
-
releaseSavepoint
- 释放给定的保存点
-
commit
-
rollback
- 回滚
-
abort
- 终止打开的连接
-
close
-
isValid
- 连接是否可用
-
isClosed
-
setTransactionIsolation, getTransactionIsolation
- 事务隔离级别
- 当前类定义了相关常量
-
setAutoCommit, getAutoCommit
- 自动提交
-
createStatement
Statement createStatement() throws SQLException;
- 不带参数的 SQL
-
prepareStatement
PreparedStatement prepareStatement(String sql) throws SQLException;
- 参数化 SQL
-
prepareCall
CallableStatement prepareCall(String sql) throws SQLException;
- 调用存储过程
-
getMetaData
- 数据库连接的元数据
DatabaseMetaData
-
setReadOnly, isReadOnly
-
setNetworkTimeout, getNetworkTimeout
-
setCatalog, getCatalog
- catalog
-
setSchema, getSchema
- schema
-
createBlob
-
createClob
-
createStruct
-
createNClob
-
createArrayOf
-
createSQLXML
-
setTypeMap, getTypeMap
-
setHoldability, getHoldability
- 保持能力
-
setClientInfo, getClientInfo
-
beginRequest
-
endRequest
-
nativeSQL
-
setShardingKey
-
setShardingKeyIfValid
- 设置分片
-
getWarnings
- 返回未处理警告中的第一个
- 在没有未处理警告时返回 null
-
clearWarnings