使用过存储过程?怎么调用?系统怎么调用存储过程的?存储过程的优点与缺点,为什么性能高?
解决方案 »
- myeclipse如何安装freemarker插件
- 系统title,keyword,description实现方式
- memcached 能否实现分页功能
- 在TOMCAT运行正常的WEB SERVICE,布署在WEBLOGIC 时有问题
- net.sf.ehcache.config.Configurator#configure : No configuration found
- 在dreamwerver中的图片为什么把代码弄到jbuilder就不显示了?
- hibernate 按时间分组查询
- apache+tomcat+mysql奇怪的jsp问题。?
- 论坛开发前端需要使用哪些技术
- 急问:jsp页面的一个请求与struts怎么连接?
- jsp页面循环数据,得到类似报表的页面
- linux WebSphere 乱码
假设 con 为已获的连接
java.sql.Connection con = super.getConnection();
java.sql.CallableStatement cs =null;
boolean validate=true;
try {
cs = con.prepareCall("{Call sp_insertReverts (?,?,?)}");
//设置他的输出参数
cs.registerOutParameter(1, java.sql.Types.INTEGER);
//给他的输入参数赋值 cs.setString(2, re.getContent());
//给他的输入参数赋值 cs.setString(3,re.getWriter());
validate= cs.execute();
//读出输出参数
cs.getInt("?的位置");
} catch (Exception e) {
// TODO: handle exception
System.out.println(" 操作数据库异常");
}finally{
//调用关闭数据连接 和 关闭cs
}
//因为 操作成功是返回false
return (!validate);