1.name字段创建索引
2.“table_c.*” 不要用”*“号,可以换成table_c.id,table_c.name,table_c.sex,table_c.email
如果可以的话,你和以在insert into table_a 中间加 append ,这样写 insert /*+ append */ into
public int deleteGoodsOne(String goodid,int status) {int i = 0
String sql = ""
conn = db.getConn()
try {
if(status == 1 || status == 2) {
sql = "update goods set status = 0 where goodid = ?"
//这里想增加update record set status = 0 where goodid = ?
}else{
sql = "update goods set status = 1 where goodid = ?"
//这里想增加update record set status = 0 where goodid = ?
}
// 第一次执行逻辑判断sql
ps = conn.prepareStatement(sql)
ps.setString(1,goodid)
i=ps.executeUpdate()
//第二次执行更新record表的sql
sql = 'update record set status = 0 where goodid = ?'
ps = conn.prepareStatement(sql)
ps.setString(1,goodid)
i=ps.executeUpdate()
} catch (SQLException e) {
e.printStackTrace()
} finally {
db.closeDB(conn)
}
return i
}
public static List<List<Map<String, Object>>>getData() {List<List<Map<String, Object>>>data = new LinkedList<List<Map<String, Object>>>()
data.add(SQLHelper.executeQuery("select * from a"))
data.add(SQLHelper.executeQuery("select * from b"))
data.add(SQLHelper.executeQuery("select * from c"))
data.add(SQLHelper.executeQuery("select * from d"))
return data
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)