自己写的一个存储过程,但只能引入一个参数,如何再引入都几个参数呢,请高手帮忙

36397 2006-02-22 05:25:16
自己写的一个存储过程,但只能引入一个参数,如何再引入都几个参数呢,请高手帮忙
public ResultSet doStore_1(String sql_store,String p1) throws Exception //执行存储过程
{
rs_store=null;
try
{
Context initCtx_store = new javax.naming.InitialContext();
Context envCtx_store = (Context) initCtx_store.lookup("java:comp/env");
DataSource ds_store = (DataSource)envCtx_store.lookup("bn");
con_store = ds_store.getConnection();
sqlStmt = con_store.prepareCall(sql_store);
sqlStmt.setString(1,p1);
rs_store = sqlStmt.executeQuery();
}
catch(SQLException e){
System.out.println("存储过程语句错误:" + sql_store);
System.err.println("存储过程错误原因:" + e.getMessage());
}
return rs_store;
}
...全文
90 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧