ApacheDbUtilsUpdate
ApacheDbUtilsUpdate
package p1; import com.DataSourceUtil;
import org.apache.commons.dbutils.QueryRunner; public class ApacheDbUtilsUpdate {
public static void main(String[] args) throws Exception {
// add();
// update();
delete();
} public static int add() throws Exception {
QueryRunner queryRunner = new QueryRunner(DataSourceUtil.getDataSourceC3p0());
String sql = "insert into student values(?,?)";
return queryRunner.update(sql, "", "zl");
} public static int update() throws Exception {
QueryRunner queryRunner = new QueryRunner(DataSourceUtil.getDataSourceC3p0());
String sql = "update student set name=? where id=?";
return queryRunner.update(sql, "xx", "");
} public static int delete() throws Exception {
QueryRunner queryRunner = new QueryRunner(DataSourceUtil.getDataSourceC3p0());
String sql = "delete from student where id=?";
return queryRunner.update(sql, "");
} }
ApacheDbUtilsUpdate的更多相关文章
随机推荐
- 包、logging模块、hashlib模块、openpyxl模块、深浅拷贝
包.logging模块.hashlib模块.openpyxl模块.深浅拷贝 一.包 1.模块与包 模块的三种来源: 1.内置的 2.第三方的 3.自定义的 模块的四种表现形式: 1.py文件 2.共享 ...
- Javascript中forEach的异步问题
某天尝试了下在 forEach函数中调用 await Promise() 方法,如下: var arr = [1,2,3] arr.forEach(async (v,i,a)=>{ await ...
- ZOJ 1002 Fire Net(dfs)
嗯... 题目链接:https://zoj.pintia.cn/problem-sets/91827364500/problems/91827364501 这道题是想出来则是一道很简单的dfs: 将一 ...
- ASP.NET Core搭建多层网站架构【2-公共基础库】
2020/01/28, ASP.NET Core 3.1, VS2019,Newtonsoft.Json 12.0.3, Microsoft.AspNetCore.Cryptography.KeyDe ...
- acm数论之旅---扩展欧几里得算法
度娘百科说: 首先, ax+by = gcd(a, b) 这个公式肯定有解 (( •̀∀•́ )她说根据数论中的相关定理可以证明,反正我信了) 所以 ax+by = gcd(a, b) * k 也肯定 ...
- 【代码审计】appcms 文件包含漏洞
index.php的开头系统都做了过滤 一个是 htmlspecialchars($v), 另一个是/^[\x{4e00}-\x{9fa5}\w {0}]+$/u. 前一个过滤是把预定义的字符 &qu ...
- 【代码审计】VAuditDemo 命令注入漏洞
一般PHP中可以使用下列函数来执行外部的应用程序或命令 system() exec() passthru() shell_exec() 跟踪$cmd --> 跟进$target,发现传递给tar ...
- Navicat for MySQL怎么往表中填数据
只有往表中更新数据,数据库才会起到真正的作用. 工具/原料 仔细阅读 方法/步骤 1.打开数据库,首先连接localhost,如图所示. 2.连接成功后,右侧便会显示已经建成的表,找到要修改的表, ...
- BUG搬运工:CSCun88303-CIMC Memory Leak : Can't SSH/HTTP to CIMC
Symptom:Unable to SSH/HTTP to the CIMC of the C-series server, however the CIMC can be pinged. Also ...
- 安装Ubuntu后的一些配置
Ubuntu安装的一些配置 搜狗拼音的安装 卸载ibus和它的配置, 卸载顶部面板的键盘指示 sudo apt remove ibus sudo apt purge ibus sudo apt rem ...