Constructor and Description |
---|
BaseAccessor() |
BaseAccessor(IAccessorConfig accessorConfig) |
Modifier and Type | Method and Description |
---|---|
protected void |
doSetupStatement(Statement statement) |
IAccessorConfig |
getAccessorConfig()
获取访问器配置对象
|
CallableStatement |
getCallableStatement(Connection conn,
String sql)
使用CallableStatement方式进行数据库访问操作,用于访问存储过程
|
PreparedStatement |
getPreparedStatement(Connection conn,
String sql)
使用PreparedStatement(参数化)方式进行数据库访问操作,用于直接使用SQL文
|
Statement |
getStatement(Connection conn)
使用Statement方式进行数据库访问操作,用于直接使用SQL文
|
void |
setAccessorConfig(IAccessorConfig accessorConfig) |
public BaseAccessor()
public BaseAccessor(IAccessorConfig accessorConfig)
protected void doSetupStatement(Statement statement) throws SQLException
SQLException
public Statement getStatement(Connection conn) throws Exception
IAccessor
getStatement
in interface IAccessor
conn
- 连接对象Exception
- 可能产生的异常public PreparedStatement getPreparedStatement(Connection conn, String sql) throws Exception
IAccessor
getPreparedStatement
in interface IAccessor
conn
- 访问数据库的连接对象sql
- 预执行的SQL语句Exception
- 可能产生的异常public CallableStatement getCallableStatement(Connection conn, String sql) throws Exception
IAccessor
getCallableStatement
in interface IAccessor
conn
- 访问数据库的连接对象sql
- 预执行的SQL语句Exception
- 可能产生的异常public IAccessorConfig getAccessorConfig()
IAccessor
getAccessorConfig
in interface IAccessor
public void setAccessorConfig(IAccessorConfig accessorConfig)
Copyright © 2022. All rights reserved.