|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.xiaoleilu.hutool.db.SqlRunner
public class SqlRunner
SQL执行类
| 构造方法摘要 | |
|---|---|
SqlRunner(DataSource ds)
|
|
| 方法摘要 | ||
|---|---|---|
Long |
execute(Connection conn,
String sql,
Object... params)
执行非查询语句 发查询语句包括 插入、更新、删除 此方法不会关闭Connection |
|
Long |
execute(String sql,
Object... params)
执行非查询语句 发查询语句包括 插入、更新、删除 |
|
int[] |
executeBatch(Connection conn,
String sql,
Object[]... paramsBatch)
批量执行非查询语句 发查询语句包括 插入、更新、删除 此方法不会关闭Connection |
|
int[] |
executeBatch(String sql,
Object[]... paramsBatch)
批量执行非查询语句 |
|
Long |
insert(Connection conn,
String tableName,
boolean isReplace,
Entity record)
插入数据 |
|
Long |
insert(String tableName,
boolean isReplace,
Entity record)
插入数据 |
|
int[] |
insertBatch(Connection conn,
String tableName,
boolean isReplace,
Entity... records)
批量插入数据 |
|
int[] |
insertBatch(String tableName,
boolean isReplace,
Entity... records)
批量插入数据 |
|
|
query(Connection conn,
String sql,
RsHandler<T> rsh,
Object... params)
查询 发查询语句包括 插入、更新、删除 此方法不会关闭Connection |
|
|
query(String sql,
RsHandler<T> rsh,
Object... params)
查询 |
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public SqlRunner(DataSource ds)
| 方法详细信息 |
|---|
public <T> T query(String sql,
RsHandler<T> rsh,
Object... params)
throws SQLException
sql - 查询语句rsh - 结果集处理对象params - 参数
SQLException
public <T> T query(Connection conn,
String sql,
RsHandler<T> rsh,
Object... params)
throws SQLException
conn - 数据库连接对象sql - 查询语句rsh - 结果集处理对象params - 参数
SQLException
public Long execute(String sql,
Object... params)
throws SQLException
sql - SQLparams - 参数
SQLException
public Long execute(Connection conn,
String sql,
Object... params)
throws SQLException
conn - 数据库连接对象sql - SQLparams - 参数
SQLException
public int[] executeBatch(String sql,
Object[]... paramsBatch)
throws SQLException
sql - SQLparamsBatch - 批量的参数
SQLException
public int[] executeBatch(Connection conn,
String sql,
Object[]... paramsBatch)
throws SQLException
conn - 数据库连接对象sql - SQLparamsBatch - 批量的参数
SQLException
public Long insert(Connection conn,
String tableName,
boolean isReplace,
Entity record)
throws SQLException
conn - 数据库连接tableName - 表名isReplace - 是否替换(会调用SQL的replace into方法)record - 记录
SQLException
public Long insert(String tableName,
boolean isReplace,
Entity record)
throws SQLException
tableName - 表名isReplace - 是否替换(会调用SQL的replace into方法)record - 记录
SQLException
public int[] insertBatch(Connection conn,
String tableName,
boolean isReplace,
Entity... records)
throws SQLException
conn - 数据库连接tableName - 表名isReplace - 是否替换(会调用SQL的replace into方法)records - 记录
SQLException
public int[] insertBatch(String tableName,
boolean isReplace,
Entity... records)
throws SQLException
tableName - 表名isReplace - 是否替换(会调用SQL的replace into方法)records - 记录
SQLException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||