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的更多相关文章

随机推荐

  1. Python 语法特点:注释/编写规则/命名规范

    1.注释 1)单行注释     # 2) 多行注释   前后三个单引号或双引号   ‘’‘  ...  '''    """  ...""" ...

  2. jinja 语法 - 整型转字符串

    大多数 jinja 相关的问题,其实查文档就解决了,但后来遇到这个问题,使得我把 jinja 官方文档,api.样例等,认真读了个遍= =. 发现没有直接的办法可以将整型转为字符串,对于需要进行字符串 ...

  3. Windows下配置Erlang环境

    1.下载地址 http://www.erlang.org/downloads 2.下载文件 下载 OTP 22.2 Windows 64-bit Binary File 3.配置环境变量 将下载的安装 ...

  4. java篇 之 继承

    this代表正在使用类的对象(的引用) java支持重载:允许在同一个类中使用相同的方法名(重载类型只区分参数列表,包括参数 顺序,参数个数,参数数据类型,与方法返回类型无关) 匹配: 方法名 参数列 ...

  5. 微信支付开发h5调用

    这两天做微信支付开发.碰到大坑.纠结死我了.好不容做完. 后台java:直接上代码:注意区分前后端的变量大小写... @RequestMapping(value = "/index" ...

  6. VBA 学习笔记 - 变量与常量

    学习资料:https://www.yiibai.com/vba/vba_variables.html 变量和常量命名规则 必须以字母开头 不能包含空格.句点(.).感叹号(!)或字符@,&,$ ...

  7. Plastic Bottle Manufacturer - Consumer Demand For Plastic Bottles Becomes Higher

    Since transparent containers enable consumers to clearly see the contents, consumers are increasingl ...

  8. Python 中多进程、多线程、协程

    进程: 一个运行的程序(代码)就是一个进程,没有运行的代码叫程序,进程是系统资源分配的最小单位,进程拥有自己独立的内存空间,所以进程间数据不共享.开销大. 线程: 调度执行的最小单位,也叫执行路径,不 ...

  9. 【渗透测试】NSA Windows 0day漏洞+修复方案

    这个漏洞是前段时间爆出来的,几乎影响了全球70%的电脑,不少高校.政府和企业都还在用Windows服务器,这次时间的影响力堪称网络大地震. ------------------------------ ...

  10. python中的type和object详解

    关于这篇博客 这篇博客主要描述Python的新风格对象(new-style objects),如下: <type 'type'>和<type 'object'>分别是什么? 用 ...