public class JdbcConnection extends JdbcAccessor
| 构造器和说明 |
|---|
JdbcConnection()
Construct a new JdbcConnection for bean usage.
|
JdbcConnection(Connection conn)
Construct a new JdbcConnection, given a Connection to obtain connections from.
|
JdbcConnection(DataSource dataSource)
Construct a new JdbcConnection, given a DataSource to obtain connections from.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
applyStatementSettings(Statement stmt)
对Statement的属性进行设置。
|
<T> T |
execute(ConnectionCallback<T> action) |
<T> T |
execute(StatementCallback<T> action) |
int |
getFetchSize() |
int |
getMaxRows() |
int |
getQueryTimeout() |
protected void |
handleWarnings(Statement stmt)
处理潜在的 SQL 警告。
|
boolean |
isIgnoreWarnings() |
void |
setFetchSize(int fetchSize) |
void |
setIgnoreWarnings(boolean ignoreWarnings) |
void |
setMaxRows(int maxRows) |
void |
setQueryTimeout(int queryTimeout) |
applyConnection, getAccessorApply, getConnection, getDataSource, setAccessorApply, setAccessorApply, setConnection, setDataSourcepublic JdbcConnection()
Note: The DataSource has to be set before using the instance.
public JdbcConnection(DataSource dataSource)
Note: This will not trigger initialization of the exception translator.
dataSource - the JDBC DataSource to obtain connections frompublic JdbcConnection(Connection conn)
Note: This will not trigger initialization of the exception translator.
conn - the JDBC Connectionpublic int getFetchSize()
public void setFetchSize(int fetchSize)
public int getMaxRows()
public void setMaxRows(int maxRows)
public int getQueryTimeout()
public void setQueryTimeout(int queryTimeout)
public boolean isIgnoreWarnings()
public void setIgnoreWarnings(boolean ignoreWarnings)
public <T> T execute(ConnectionCallback<T> action) throws SQLException
SQLExceptionpublic <T> T execute(StatementCallback<T> action) throws SQLException
SQLExceptionprotected void applyStatementSettings(Statement stmt) throws SQLException
SQLExceptionprotected void handleWarnings(Statement stmt) throws SQLException
SQLExceptionCopyright © 2020–2021. All rights reserved.