public class DB_Update extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 限定符和类型 | 字段和说明 |
|---|---|
protected Connection |
conn
The Conn.
|
static boolean |
debug
是否显示日志
|
| 构造器和说明 |
|---|
DB_Update(Connection conn)
Instantiates a new Db update.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected static int |
delete(Connection conn,
String tableName,
String where,
Object... param)
执行sql delete
|
int |
delete(String tableName,
String where,
Object... param)
Delete int.
|
protected static int |
deleteById(Connection conn,
String tableName,
String id)
执行sql delete
|
int |
deleteById(String tableName,
String id)
Delete by id int.
|
protected static int |
executeUpdate_(Connection conn,
String sql,
Object[] param)
executeUpdate
|
protected static int |
executeUpdate(Connection conn,
String sql)
executeUpdate
|
protected static int |
executeUpdate(Connection conn,
String sql,
Object... param)
executeUpdate
|
int |
executeUpdate(SqlQuery sqlQuery)
executeQuery
|
int |
executeUpdate(String sql)
executeUpdate
|
int |
executeUpdate(String sql,
Object... param)
executeUpdate
|
protected static int[] |
executeUpdateMultiple(Connection conn,
SqlQuery[] sql)
executeUpdateMultiple
|
int[] |
executeUpdateMultiple(SqlQuery[] sql)
executeUpdateMultiple
|
protected static int |
executeUpdateSingleColumn(Connection conn,
String tableName,
String column,
Object value,
String where,
String... param)
更新单列数据
|
protected static int |
executeUpdateSingleColumn(Connection conn,
String tableName,
String column,
Object value,
String idName,
String id)
更新单列数据
|
int |
executeUpdateSingleColumn(String tableName,
String column,
Object value,
String where,
String... param)
更新单列数据
|
int |
executeUpdateSingleColumn(String tableName,
String column,
Object value,
String idName,
String id)
更新单列数据
|
protected static int |
executeUpdateSingleColumnAdd(Connection conn,
String tableName,
String column,
BigDecimal value,
String where,
String... param)
执行sql update++
|
int |
executeUpdateSingleColumnAdd(String tableName,
String column,
BigDecimal value,
String where,
String... param)
执行sql update++
|
int |
executeUpdateSingleColumnById(String tableName,
String column,
Object value,
String id)
更新单列数据
|
protected static int |
executeUpdateSingleColumnSubtract(Connection conn,
String tableName,
String column,
BigDecimal value,
String where,
String... param)
执行sql update--
|
int |
executeUpdateSingleColumnSubtract(String tableName,
String column,
BigDecimal value,
String where,
String... param)
执行sql update--
|
protected static int |
insert(Connection conn,
String tableName,
String[] column,
Object... value)
执行sql insert
|
int |
insert(String tableName,
String[] column,
Object... value)
Insert int.
|
protected static int |
updateById(Connection conn,
String tableName,
String id,
String[] column,
Object... value)
执行sql update
|
int |
updateById(String tableName,
String id,
String[] column,
Object... value)
Update by id int.
|
protected Connection conn
public static boolean debug
public DB_Update(Connection conn)
conn - the connpublic int executeUpdate(String sql)
sql - sql语句public int executeUpdate(String sql, Object... param)
sql - sql语句param - 参数对象public int executeUpdate(SqlQuery sqlQuery)
sqlQuery - the sql querypublic int[] executeUpdateMultiple(SqlQuery[] sql)
sql - sql语句(多个)public int executeUpdateSingleColumnAdd(String tableName, String column, BigDecimal value, String where, String... param)
tableName - the table namecolumn - the columnvalue - the valuewhere - the whereparam - the parampublic int executeUpdateSingleColumnSubtract(String tableName, String column, BigDecimal value, String where, String... param)
tableName - the table namecolumn - the columnvalue - the valuewhere - the whereparam - the parampublic int executeUpdateSingleColumn(String tableName, String column, Object value, String idName, String id)
tableName - the table namecolumn - the columnvalue - the valueidName - the id nameid - the idpublic int executeUpdateSingleColumn(String tableName, String column, Object value, String where, String... param)
tableName - the table namecolumn - the columnvalue - the valuewhere - the whereparam - the parampublic int executeUpdateSingleColumnById(String tableName, String column, Object value, String id)
tableName - the table namecolumn - the columnvalue - the valueid - the idpublic int insert(String tableName, String[] column, Object... value)
tableName - the table namecolumn - the columnvalue - the valuepublic int delete(String tableName, String where, Object... param)
tableName - the table namewhere - the whereparam - the parampublic int deleteById(String tableName, String id)
tableName - the table nameid - the idpublic int updateById(String tableName, String id, String[] column, Object... value)
tableName - the table nameid - the idcolumn - the columnvalue - the valueprotected static int executeUpdate(Connection conn, String sql, Object... param)
conn - 连接对象sql - sql语句param - 参数对象protected static int executeUpdate(Connection conn, String sql)
conn - 连接对象sql - sql语句protected static int executeUpdate_(Connection conn, String sql, Object[] param)
conn - 连接对象sql - sql语句param - 参数对象protected static int[] executeUpdateMultiple(Connection conn, SqlQuery[] sql)
conn - 连接对象sql - sql语句(多个)protected static int executeUpdateSingleColumn(Connection conn, String tableName, String column, Object value, String idName, String id)
conn - the conntableName - the table namecolumn - the columnvalue - the valueidName - the id nameid - the idprotected static int executeUpdateSingleColumn(Connection conn, String tableName, String column, Object value, String where, String... param)
conn - the conntableName - the table namecolumn - the columnvalue - the valuewhere - the whereparam - the paramprotected static int executeUpdateSingleColumnAdd(Connection conn, String tableName, String column, BigDecimal value, String where, String... param)
conn - the conntableName - the table namecolumn - the columnvalue - the valuewhere - the whereparam - the paramprotected static int executeUpdateSingleColumnSubtract(Connection conn, String tableName, String column, BigDecimal value, String where, String... param)
conn - the conntableName - the table namecolumn - the columnvalue - the valuewhere - the whereparam - the paramprotected static int insert(Connection conn, String tableName, String[] column, Object... value)
conn - the conntableName - the table namecolumn - the columnvalue - the valueprotected static int deleteById(Connection conn, String tableName, String id)
conn - the conntableName - the table nameid - the idprotected static int delete(Connection conn, String tableName, String where, Object... param)
conn - the conntableName - the table namewhere - the whereparam - the paramprotected static int updateById(Connection conn, String tableName, String id, String[] column, Object... value)
conn - the conntableName - the table nameid - the idcolumn - the columnvalue - the valueCopyright © 2020. All rights reserved.