自己写的一个存储过程,但只能引入一个参数,如何再引入都几个参数呢,请高手帮忙
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;
}