public void update(String sql,Object ... args){
Connection connection = null;
try {
connection = JdbcUtils.getConnection();
queryRunner.update(connection, sql, args);
System.out.println("here...");
} catch (Exception e) {
e.printStackTrace();
}finally {
JdbcUtils.releaseConnection(connection);
}
}
public class Test extends DAO<Customer>{
@org.junit.Test
public void test(){
String sql = "delete customer where \"id\" = ?";
System.out.println("start");
update(sql, 2);
System.out.println("success");
}
}
如上,求各位解答,谢谢!
Connection connection = null;
try {
connection = JdbcUtils.getConnection();
queryRunner.update(connection, sql, args);
System.out.println("here...");
} catch (Exception e) {
e.printStackTrace();
}finally {
JdbcUtils.releaseConnection(connection);
}
}
public class Test extends DAO<Customer>{
@org.junit.Test
public void test(){
String sql = "delete customer where \"id\" = ?";
System.out.println("start");
update(sql, 2);
System.out.println("success");
}
}
如上,求各位解答,谢谢!
解决方案 »
- The content of element type "session-factory" must match "(property*,mapping*,(c
- hibernate 刷新问题
- struts中的一个异常
- 我用hibernate+jsp+strits做了一个登陆可老报同样的错都3天了各位前辈帮忙
- OpenSessionInViewFilter的疑问
- 如何搭建TOMCAT+MYSQL服务器
- 找北京的java师傅 不看我们都亏了
- 在jsp中用jdbc-odbc连接sql srver的问题!
- 连接池啊,郁闷的连接池啊,错误提示连接池无可用资源
- 请教一个关于组合框的setSelectedIndex()方法,怎么都想不明白啊
- JSch连接主机
- 求问maven项目怎么快速转换为非maven项目
id上面不用加 " 直接: String sql = "delete customer where id = ? "; 就可以吧