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) |
int |
getFetchSize() |
int |
getMaxRows() |
int |
getQueryTimeout() |
void |
setFetchSize(int fetchSize) |
void |
setMaxRows(int maxRows) |
void |
setQueryTimeout(int queryTimeout) |
getConnection, getDataSource, 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 <T> T execute(ConnectionCallback<T> action) throws SQLException
SQLExceptionprotected void applyStatementSettings(Statement stmt) throws SQLException
SQLExceptionCopyright © 2020. All rights reserved.