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的更多相关文章
随机推荐
- awk命令_Linux awk 命令用法详解
本文索引 awk命令格式和选项 awk模式和操作 模式 操作 awk脚本基本结构 awk的工作原理 awk内置变量(预定义变量) 将外部变量值传递给awk awk运算与判断 算术运算符 赋值运算符 逻 ...
- C:字符数组 与 字符串
字符串与字符数组 C语言中没有字符串这种数据类型,可以通过char的数组来替代: 字符串一定是一个char的数组,但char的数组未必是字符串: 数字0(和字符'\0'等价)结尾的char数组就是一个 ...
- RTT学习之sensor设备
Sensor设备的常用操作: 首先查找传感器设置获取设备句柄.rt_device_find 以轮询.FIFO.中断.任意一种方式打开传感器,中断和FIFO需要设置接收回调函数(释放一个信号量给接收线程 ...
- ubuntu16.04/ubuntu18.04安装网易云音乐
一.下载1.0版本 下载地址:http://s1.music.126.net/download/pc/netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb 下 ...
- POJ 2142 The Balance(exgcd)
嗯... 题目链接:http://poj.org/problem?id=2142 AC代码: #include<cstdio> #include<iostream> using ...
- c++开源库rapidxm
1.引入头文件: 一般用到的头文件: #include "rapidxml/rapidxml.hpp" #include "rapidxml/rapidxml_utils ...
- 跨域-JSONP
jsonp跨域 - 前端适配,后台配合 说明:前后台同时改造 cnpm i jsonp --save-dev 在App.vue里 import jsonp from 'jsonp' let url = ...
- Python:字典类型
概念 无序的,可变的,键值对集合 定义 方式1 {key1: value1, key2: value2, ......} 方式2 fromkeys(S, v=None) 静态方法:类和对象都可以调用 ...
- 使用URLConnection获取页面返回的xml数据
public static void main(String[] args) throws Exception { String path="http://flash.weather.com ...
- 201771010135杨蓉庆 《面对对象程序设计(java)》第七周学习总结
学习目标 1.深入理解OO程序设计的特征:继承.多态: 2.熟练掌握Java语言中基于类.继承技术构造程序的语法知识: 3.利用继承定义类设计程序,能够设计开发含有1个主类.2个以上用户自定义类的应用 ...