public abstract class JDBCExecuteUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
COMMA_SPACE |
static String |
SPACE_AND_SPACE |
static String |
SPACE_EQ_SPACE |
| 构造器和说明 |
|---|
JDBCExecuteUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> void |
addBatch(PreparedStatement ps,
List<FieldMeta> fieldMetas,
T obj)
添加一个批量
|
static <T> void |
addBatch(PreparedStatement ps,
T obj,
List<Field> fields)
添加一个批量
|
static <T> T |
execute(Connection con,
String id,
String sql,
List<Object> params,
SQLExecuter<T> sqlExecuter,
boolean showSql)
执行一个SQL语句
|
static <T extends Serializable> |
executeBatch(Connection con,
boolean showSql,
List<T> rows,
DMLParser dmlParser)
使用实体对象列表批处理插入、更新或删除数据
|
static <T> int |
hardSave(Connection con,
SQLDialect dialect,
boolean showSql,
List<T> rows)
使用实体对象列表硬保存数据
|
static <T extends Serializable> |
hardUpdate(Connection con,
boolean showSql,
List<T> rows)
使用实体对象列表硬更新数据
|
static <T> int |
save(Connection con,
boolean showSql,
List<T> rows,
MergeSQL mergeSql)
使用实体对象列表软保存数据
|
static <T> int |
update(Connection con,
boolean showSql,
List<T> rows,
UpdateSQL updateSQL)
使用实体对象列表软更新数据
|
public static <T> T execute(Connection con, String id, String sql, List<Object> params, SQLExecuter<T> sqlExecuter, boolean showSql) throws SQLException
con - 连接对象sql - SQL语句params - 参数sqlExecuter - SQL执行器showSql - 是否打印SQLSQLException - SQL异常public static <T extends Serializable> int executeBatch(Connection con, boolean showSql, List<T> rows, DMLParser dmlParser) throws SQLException
con - 连接对象showSql - 是否打印SQLrows - 实体对象列表dmlParser - 数据库操纵对象SQLException - SQL异常public static <T> int update(Connection con, boolean showSql, List<T> rows, UpdateSQL updateSQL) throws SQLException
con - 连接对象showSql - 是否打印SQLrows - 实体对象列表updateSQL - 更新数据操作对象SQLException - SQL异常public static <T extends Serializable> int hardUpdate(Connection con, boolean showSql, List<T> rows) throws SQLException
con - 连接对象showSql - 是否打印SQLrows - 实体对象列表SQLException - SQL异常public static <T> int save(Connection con, boolean showSql, List<T> rows, MergeSQL mergeSql) throws SQLException
con - 连接对象showSql - 是否打印SQLrows - 实体对象列表mergeSql - 合并数据操作对象SQLException - SQL异常public static <T> int hardSave(Connection con, SQLDialect dialect, boolean showSql, List<T> rows) throws SQLException
con - 连接对象showSql - 是否打印SQLrows - 实体对象列表SQLException - SQL异常public static final <T> void addBatch(PreparedStatement ps, List<FieldMeta> fieldMetas, T obj) throws SQLException
ps - 准备声明对象fieldMetas - 属性元数据列表obj - 实体对象SQLException - SQL异常public static final <T> void addBatch(PreparedStatement ps, T obj, List<Field> fields) throws SQLException
ps - 准备声明对象obj - 实体对象fields - 属性列表SQLException - SQL异常Copyright © 2021 10MG. All rights reserved.