public class SimpleSqlExecutor extends Object implements SqlExecutor
| 构造器和说明 |
|---|
SimpleSqlExecutor(DataSource dataSource,
String sql,
Object[] args) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected org.noear.solon.data.sql.impl.CommandHolder |
buildCommand(String sql,
boolean returnKeys,
boolean isStream)
构建预处理
|
protected Connection |
getConnection()
获取连接(为转换提供重写机会)
|
Row |
queryRow()
已过时。
3.0
|
<T> T |
queryRow(Class<T> tClass)
查询并获取行
|
<T> T |
queryRow(RowConverter<T> converter)
查询并获取行
|
<T> RowIterator<T> |
queryRowIterator(int fetchSize,
Class<T> tClass)
查询并获取行遍历器(流式读取)
|
<T> RowIterator<T> |
queryRowIterator(int fetchSize,
RowConverter<T> converter)
查询并获取行遍历器(流式读取)
|
RowList |
queryRowList()
已过时。
3.0
|
<T> List<T> |
queryRowList(Class<T> tClass)
查询并获取行列表
|
<T> List<T> |
queryRowList(RowConverter<T> converter)
查询并获取行列表
|
<T> T |
queryValue()
查询并获取值
|
<T> List<T> |
queryValueList()
查询并获取值列表
|
int |
update()
更新(插入、或更新、或删除)
|
<S> int |
update(S args,
StatementBinder<S> binder)
批量更新(插入、或更新、或删除)
|
int[] |
updateBatch(Collection<Object[]> argsList)
批量更新(插入、或更新、或删除)
|
<T> int[] |
updateBatch(Collection<T> argsList,
StatementBinder<T> binder)
批量更新(插入、或更新、或删除)
|
<T> T |
updateReturnKey()
更新并返回主键
|
<T,S> T |
updateReturnKey(S args,
StatementBinder<S> binder)
更新并返回主键
|
public SimpleSqlExecutor(DataSource dataSource, String sql, Object[] args)
public <T> T queryValue()
throws SQLException
SqlExecutorqueryValue 在接口中 SqlExecutorSQLExceptionpublic <T> List<T> queryValueList() throws SQLException
SqlExecutorqueryValueList 在接口中 SqlExecutorSQLExceptionpublic <T> T queryRow(Class<T> tClass) throws SQLException
SqlExecutorqueryRow 在接口中 SqlExecutortClass - Map.class or T.classSQLExceptionpublic <T> T queryRow(RowConverter<T> converter) throws SQLException
SqlExecutorqueryRow 在接口中 SqlExecutorSQLExceptionpublic <T> List<T> queryRowList(Class<T> tClass) throws SQLException
SqlExecutorqueryRowList 在接口中 SqlExecutortClass - Map.class or T.classSQLExceptionpublic <T> List<T> queryRowList(RowConverter<T> converter) throws SQLException
SqlExecutorqueryRowList 在接口中 SqlExecutorSQLExceptionpublic <T> RowIterator<T> queryRowIterator(int fetchSize, Class<T> tClass) throws SQLException
SqlExecutorqueryRowIterator 在接口中 SqlExecutortClass - Map.class or T.classSQLExceptionpublic <T> RowIterator<T> queryRowIterator(int fetchSize, RowConverter<T> converter) throws SQLException
SqlExecutorqueryRowIterator 在接口中 SqlExecutorSQLExceptionpublic int update()
throws SQLException
SqlExecutorupdate 在接口中 SqlExecutorSQLExceptionpublic <S> int update(S args,
StatementBinder<S> binder)
throws SQLException
SqlExecutorupdate 在接口中 SqlExecutorargs - 参数binder - 绑定器SQLExceptionpublic int[] updateBatch(Collection<Object[]> argsList) throws SQLException
SqlExecutorupdateBatch 在接口中 SqlExecutorargsList - 参数集合SQLExceptionpublic <T> int[] updateBatch(Collection<T> argsList, StatementBinder<T> binder) throws SQLException
SqlExecutorupdateBatch 在接口中 SqlExecutorargsList - 参数集合binder - 绑定器SQLExceptionpublic <T> T updateReturnKey()
throws SQLException
SqlExecutorupdateReturnKey 在接口中 SqlExecutorSQLExceptionpublic <T,S> T updateReturnKey(S args,
StatementBinder<S> binder)
throws SQLException
SqlExecutorupdateReturnKey 在接口中 SqlExecutorSQLExceptionprotected org.noear.solon.data.sql.impl.CommandHolder buildCommand(String sql, boolean returnKeys, boolean isStream) throws SQLException
SQLExceptionprotected Connection getConnection() throws SQLException
SQLException@Deprecated public Row queryRow() throws SQLException
SqlExecutorqueryRow 在接口中 SqlExecutorSQLException@Deprecated public RowList queryRowList() throws SQLException
SqlExecutorqueryRowList 在接口中 SqlExecutorSQLExceptionCopyright © 2024. All rights reserved.