友情链接:
上一篇为读者介绍了基于 JDBC 开发的开发流程以及提供了示例代码,如果您是首次尝试开发还不了解具体的开发步骤,可以查看上篇文章进行了解:Inceptor/ArgoDB开发者指南系列之_基于JDBC开发(上)
本篇文章将为读者介绍 JDBC 4 支持的接口及返回类型功能参考,包含以下接口,具体可以选择右侧目录按需查看:
数据库连接接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| close() | void |
| commit() | void |
| createStatement() | Statement |
| getAutoCommit() | boolean |
| getClientInfo() | Properties |
| getClientInfo(String name) | String |
| getTransactionIsolation() | int |
| isClosed() | boolean |
| isReadOnly() | boolean |
| prepareStatement(String sql) | PreparedStatement |
| rollback() | void |
| setAutoCommit(boolean autoCommit) | void |
| setClientInfo(Properties properties) | void |
| setClientInfo(String name,String value) | void |
存储过程执行接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| registerOutParameter(int parameterIndex, int type) | void |
| wasNull() | boolean |
| getString(int parameterIndex) | String |
| getBoolean(int parameterIndex) | boolean |
| getByte(int parameterIndex) | byte |
| getShort(int parameterIndex) | short |
| getInt(int parameterIndex) | int |
| getLong(int parameterIndex) | long |
| getFloat(int parameterIndex) | float |
| getDouble(int parameterIndex) | double |
| getBigDecimal(int parameterIndex) | BigDecimal |
| getBytes(int parameterIndex) | byte[] |
| getDate(int parameterIndex) | Date |
| getTime(int parameterIndex) | Time |
| getTimestamp(int parameterIndex) | Timestamp |
| getObject(int parameterIndex) | Object |
数据库对象定义接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getTables(String catalog,String schemaPattern, String tableNamePattern, String[] types) | ResultSet |
| getColumns(String catalog,String schemaPattern, String tableNamePattern, String columnNamePattern) | ResultSet |
| getTableTypes() | ResultSet |
| getUserName() | String |
| isReadOnly() | boolean |
| nullsAreSortedHigh() | boolean |
| nullsAreSortedLow() | boolean |
| nullsAreSortedAtStart() | boolean |
| nullsAreSortedAtEnd() | boolean |
| getDatabaseProductName() | String |
| getDatabaseProductVersion() | String |
| getDriverName() | String |
| getDriverVersion() | String |
| getDriverMajorVersion() | int |
| getDriverMinorVersion() | int |
| usesLocalFiles() | boolean |
| usesLocalFilePerTable() | boolean |
| supportsMixedCaseIdentifiers() | boolean |
| storesUpperCaseIdentifiers() | boolean |
| storesLowerCaseIdentifiers() | boolean |
| supportsMixedCaseQuotedIdentifiers() | boolean |
| storesUpperCaseQuotedIdentifiers() | boolean |
| storesLowerCaseQuotedIdentifiers() | boolean |
| storesMixedCaseQuotedIdentifiers() | boolean |
| supportsAlterTableWithAddColumn() | boolean |
| supportsAlterTableWithDropColumn() | boolean |
| supportsColumnAliasing() | boolean |
| nullPlusNonNullIsNull() | boolean |
| supportsConvert() | boolean |
| supportsConvert(int fromType, int toType) | boolean |
| supportsTableCorrelationNames() | boolean |
| supportsDifferentTableCorrelationNames() | boolean |
| supportsExpressionsInOrderBy() | boolean |
| supportsOrderByUnrelated() | boolean |
| supportsGroupBy() | boolean |
| supportsGroupByUnrelated() | boolean |
| supportsGroupByBeyondSelect() | boolean |
| supportsLikeEscapeClause() | boolean |
| supportsMultipleResultSets() | boolean |
| supportsMultipleTransactions() | boolean |
| supportsNonNullableColumns() | boolean |
| supportsMinimumSQLGrammar() | boolean |
| supportsCoreSQLGrammar() | boolean |
| supportsExtendedSQLGrammar() | boolean |
| supportsANSI92EntryLevelSQL() | boolean |
| supportsANSI92IntermediateSQL() | boolean |
| supportsANSI92FullSQL() | boolean |
| supportsIntegrityEnhancementFacility() | boolean |
| supportsOuterJoins() | boolean |
| supportsFullOuterJoins() | boolean |
| supportsLimitedOuterJoins() | boolean |
| isCatalogAtStart() | boolean |
| supportsSchemasInDataManipulation() | boolean |
| supportsSavepoints() | boolean |
| supportsResultSetHoldability(int holdability) | boolean |
| getResultSetHoldability() | int |
| getDatabaseMajorVersion() | int |
| getDatabaseMinorVersion() | int |
| getJDBCMajorVersion() | int |
| getJDBCMinorVersion() | int |
数据库驱动接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| acceptsURL(String url) | boolean |
| connect(String url, Properties info) | Connection |
| jdbcCompliant() | boolean |
| getMajorVersion() | int |
| getMinorVersion() | int |
预处理语句接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| clearParameters() | void |
| execute() | boolean |
| executeQuery() | ResultSet |
| excuteUpdate() | int |
| getMetaData() | ResultSetMetaData |
| setBoolean(int parameterIndex, boolean x) | void |
| setBigDecimal(int parameterIndex,BigDecimal x) | void |
| setByte(int parameterIndex, byte x) | void |
| setBytes(int parameterIndex, byte[]x) | void |
| setDate(int parameterIndex, Date x) | void |
| setDouble(int parameterIndex, doublex) | void |
| setFloat(int parameterIndex, float x) | void |
| setInt(int parameterIndex, int x) | void |
| setLong(int parameterIndex, long x) | void |
| setShort(int parameterIndex, short x) | void |
| setString(int parameterIndex, String x) | void |
| addBatch() | void |
| executeBatch() | int[] |
| clearBatch() | void |
执行结果集接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| findColumn(String columnLabel) | int |
| getBigDecimal(int columnIndex) | BigDecimal |
| getBigDecimal(String columnLabel) | BigDecimal |
| getBoolean(int columnIndex) | boolean |
| getBoolean(String columnLabel) | boolean |
| getByte(int columnIndex) | byte |
| getBytes(int columnIndex) | byte[] |
| getByte(String columnLabel) | byte |
| getBytes(String columnLabel) | byte[] |
| getDate(int columnIndex) | Date |
| getDate(String columnLabel) | Date |
| getDouble(int columnIndex) | double |
| getDouble(String columnLabel) | double |
| getFloat(int columnIndex) | float |
| getFloat(String columnLabel) | float |
| getInt(int columnIndex) | int |
| getInt(String columnLabel) | int |
| getLong(int columnIndex) | long |
| getLong(String columnLabel) | long |
| getShort(int columnIndex) | short |
| getShort(String columnLabel) | short |
| getString(int columnIndex) | String |
| getString(String columnLabel) | String |
| getTime(int columnIndex) | Time |
| getTime(String columnLabel) | Time |
| getTimestamp(int columnIndex) | Timestamp |
| getTimestamp(String columnLabel) | Timestamp |
| isAfterLast() | boolean |
| isBeforeFirst() | boolean |
| isFirst() | boolean |
| next() | boolean |
描述 ResultSet 对象的相关信息,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getColumnCount() | int |
| getColumnName(int column) | String |
| getColumnType(int column) | int |
| getColumnTypeName(int column) | String |
SQL 语句接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| close() | void |
| execute(String sql) | boolean |
| executeQuery(String sql) | ResultSet |
| executeUpdate(String sql) | int |
| getConnection() | Connection |
| getResultSet() | ResultSet |
| getQueryTimeout() | int |
| getUpdateCount() | int |
| isClosed() | boolean |
| setQueryTimeout(int seconds) | void |
| setFetchSize(int rows) | void |
| cancel() | void |
数据源连接池接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getLoginTimeout() | int |
| getLogWriter() | PrintWriter |
| getPooledConnection() | PooledConnection |
| getPooledConnection(String user,String password) | PooledConnection |
| setLoginTimeout(int seconds) | void |
| setLogWriter(PrintWriter out) | void |
数据源接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getConneciton() | Connection |
| getConnection(String username,String password) | Connection |
| getLoginTimeout() | int |
| getLogWriter() | PrintWriter |
| setLoginTimeout(int seconds) | void |
| setLogWriter(PrintWriter out) | void |
由连接池创建的连接接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| addConnectionEventListener(ConnectionEventListener listener) | void |
| close() | void |
| getConnection() | Connection |
| removeConnectionEventListener(ConnectionEventListener listener) | void |
| addStatementEventListener(StatementEventListener listener) | void |
| removeStatementEventListener(StatementEventListener listener) | void |
如果上述内容对您有提供帮助,欢迎多多点赞支持~😎


友情链接:
上一篇为读者介绍了基于 JDBC 开发的开发流程以及提供了示例代码,如果您是首次尝试开发还不了解具体的开发步骤,可以查看上篇文章进行了解:Inceptor/ArgoDB开发者指南系列之_基于JDBC开发(上)
本篇文章将为读者介绍 JDBC 4 支持的接口及返回类型功能参考,包含以下接口,具体可以选择右侧目录按需查看:
数据库连接接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| close() | void |
| commit() | void |
| createStatement() | Statement |
| getAutoCommit() | boolean |
| getClientInfo() | Properties |
| getClientInfo(String name) | String |
| getTransactionIsolation() | int |
| isClosed() | boolean |
| isReadOnly() | boolean |
| prepareStatement(String sql) | PreparedStatement |
| rollback() | void |
| setAutoCommit(boolean autoCommit) | void |
| setClientInfo(Properties properties) | void |
| setClientInfo(String name,String value) | void |
存储过程执行接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| registerOutParameter(int parameterIndex, int type) | void |
| wasNull() | boolean |
| getString(int parameterIndex) | String |
| getBoolean(int parameterIndex) | boolean |
| getByte(int parameterIndex) | byte |
| getShort(int parameterIndex) | short |
| getInt(int parameterIndex) | int |
| getLong(int parameterIndex) | long |
| getFloat(int parameterIndex) | float |
| getDouble(int parameterIndex) | double |
| getBigDecimal(int parameterIndex) | BigDecimal |
| getBytes(int parameterIndex) | byte[] |
| getDate(int parameterIndex) | Date |
| getTime(int parameterIndex) | Time |
| getTimestamp(int parameterIndex) | Timestamp |
| getObject(int parameterIndex) | Object |
数据库对象定义接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getTables(String catalog,String schemaPattern, String tableNamePattern, String[] types) | ResultSet |
| getColumns(String catalog,String schemaPattern, String tableNamePattern, String columnNamePattern) | ResultSet |
| getTableTypes() | ResultSet |
| getUserName() | String |
| isReadOnly() | boolean |
| nullsAreSortedHigh() | boolean |
| nullsAreSortedLow() | boolean |
| nullsAreSortedAtStart() | boolean |
| nullsAreSortedAtEnd() | boolean |
| getDatabaseProductName() | String |
| getDatabaseProductVersion() | String |
| getDriverName() | String |
| getDriverVersion() | String |
| getDriverMajorVersion() | int |
| getDriverMinorVersion() | int |
| usesLocalFiles() | boolean |
| usesLocalFilePerTable() | boolean |
| supportsMixedCaseIdentifiers() | boolean |
| storesUpperCaseIdentifiers() | boolean |
| storesLowerCaseIdentifiers() | boolean |
| supportsMixedCaseQuotedIdentifiers() | boolean |
| storesUpperCaseQuotedIdentifiers() | boolean |
| storesLowerCaseQuotedIdentifiers() | boolean |
| storesMixedCaseQuotedIdentifiers() | boolean |
| supportsAlterTableWithAddColumn() | boolean |
| supportsAlterTableWithDropColumn() | boolean |
| supportsColumnAliasing() | boolean |
| nullPlusNonNullIsNull() | boolean |
| supportsConvert() | boolean |
| supportsConvert(int fromType, int toType) | boolean |
| supportsTableCorrelationNames() | boolean |
| supportsDifferentTableCorrelationNames() | boolean |
| supportsExpressionsInOrderBy() | boolean |
| supportsOrderByUnrelated() | boolean |
| supportsGroupBy() | boolean |
| supportsGroupByUnrelated() | boolean |
| supportsGroupByBeyondSelect() | boolean |
| supportsLikeEscapeClause() | boolean |
| supportsMultipleResultSets() | boolean |
| supportsMultipleTransactions() | boolean |
| supportsNonNullableColumns() | boolean |
| supportsMinimumSQLGrammar() | boolean |
| supportsCoreSQLGrammar() | boolean |
| supportsExtendedSQLGrammar() | boolean |
| supportsANSI92EntryLevelSQL() | boolean |
| supportsANSI92IntermediateSQL() | boolean |
| supportsANSI92FullSQL() | boolean |
| supportsIntegrityEnhancementFacility() | boolean |
| supportsOuterJoins() | boolean |
| supportsFullOuterJoins() | boolean |
| supportsLimitedOuterJoins() | boolean |
| isCatalogAtStart() | boolean |
| supportsSchemasInDataManipulation() | boolean |
| supportsSavepoints() | boolean |
| supportsResultSetHoldability(int holdability) | boolean |
| getResultSetHoldability() | int |
| getDatabaseMajorVersion() | int |
| getDatabaseMinorVersion() | int |
| getJDBCMajorVersion() | int |
| getJDBCMinorVersion() | int |
数据库驱动接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| acceptsURL(String url) | boolean |
| connect(String url, Properties info) | Connection |
| jdbcCompliant() | boolean |
| getMajorVersion() | int |
| getMinorVersion() | int |
预处理语句接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| clearParameters() | void |
| execute() | boolean |
| executeQuery() | ResultSet |
| excuteUpdate() | int |
| getMetaData() | ResultSetMetaData |
| setBoolean(int parameterIndex, boolean x) | void |
| setBigDecimal(int parameterIndex,BigDecimal x) | void |
| setByte(int parameterIndex, byte x) | void |
| setBytes(int parameterIndex, byte[]x) | void |
| setDate(int parameterIndex, Date x) | void |
| setDouble(int parameterIndex, doublex) | void |
| setFloat(int parameterIndex, float x) | void |
| setInt(int parameterIndex, int x) | void |
| setLong(int parameterIndex, long x) | void |
| setShort(int parameterIndex, short x) | void |
| setString(int parameterIndex, String x) | void |
| addBatch() | void |
| executeBatch() | int[] |
| clearBatch() | void |
执行结果集接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| findColumn(String columnLabel) | int |
| getBigDecimal(int columnIndex) | BigDecimal |
| getBigDecimal(String columnLabel) | BigDecimal |
| getBoolean(int columnIndex) | boolean |
| getBoolean(String columnLabel) | boolean |
| getByte(int columnIndex) | byte |
| getBytes(int columnIndex) | byte[] |
| getByte(String columnLabel) | byte |
| getBytes(String columnLabel) | byte[] |
| getDate(int columnIndex) | Date |
| getDate(String columnLabel) | Date |
| getDouble(int columnIndex) | double |
| getDouble(String columnLabel) | double |
| getFloat(int columnIndex) | float |
| getFloat(String columnLabel) | float |
| getInt(int columnIndex) | int |
| getInt(String columnLabel) | int |
| getLong(int columnIndex) | long |
| getLong(String columnLabel) | long |
| getShort(int columnIndex) | short |
| getShort(String columnLabel) | short |
| getString(int columnIndex) | String |
| getString(String columnLabel) | String |
| getTime(int columnIndex) | Time |
| getTime(String columnLabel) | Time |
| getTimestamp(int columnIndex) | Timestamp |
| getTimestamp(String columnLabel) | Timestamp |
| isAfterLast() | boolean |
| isBeforeFirst() | boolean |
| isFirst() | boolean |
| next() | boolean |
描述 ResultSet 对象的相关信息,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getColumnCount() | int |
| getColumnName(int column) | String |
| getColumnType(int column) | int |
| getColumnTypeName(int column) | String |
SQL 语句接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| close() | void |
| execute(String sql) | boolean |
| executeQuery(String sql) | ResultSet |
| executeUpdate(String sql) | int |
| getConnection() | Connection |
| getResultSet() | ResultSet |
| getQueryTimeout() | int |
| getUpdateCount() | int |
| isClosed() | boolean |
| setQueryTimeout(int seconds) | void |
| setFetchSize(int rows) | void |
| cancel() | void |
数据源连接池接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getLoginTimeout() | int |
| getLogWriter() | PrintWriter |
| getPooledConnection() | PooledConnection |
| getPooledConnection(String user,String password) | PooledConnection |
| setLoginTimeout(int seconds) | void |
| setLogWriter(PrintWriter out) | void |
数据源接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| getConneciton() | Connection |
| getConnection(String username,String password) | Connection |
| getLoginTimeout() | int |
| getLogWriter() | PrintWriter |
| setLoginTimeout(int seconds) | void |
| setLogWriter(PrintWriter out) | void |
由连接池创建的连接接口,相关方法名和返回值类型如下。
| 方法名 | 返回值类型 |
|---|---|
| addConnectionEventListener(ConnectionEventListener listener) | void |
| close() | void |
| getConnection() | Connection |
| removeConnectionEventListener(ConnectionEventListener listener) | void |
| addStatementEventListener(StatementEventListener listener) | void |
| removeStatementEventListener(StatementEventListener listener) | void |
如果上述内容对您有提供帮助,欢迎多多点赞支持~😎

