■■■jsp调用oracle存储过程问题??■■■

southline 2004-07-30 01:01:36
我的代码如下:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@192.168.0.16:1521:xxxx";
//orcl为你的数据库的SID
String user="xxxx";
String password="xxxx";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
CallableStatement proc = conn.prepareCall("{ ?=call pkgxCommon.prcListDealForms() }");
proc.registerOutParameter(1, Types.OTHER);
proc.execute();
ResultSet rs = (ResultSet) proc.getObject(1);
proc.close();
conn.close();
%>
</body>
</html>



出现以下的错误,请帮忙解决!!!谢谢!!!!
javax.servlet.ServletException: ??????
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.tdb_jsp._jspService(tdb_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
...全文
136 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zheng79 2004-12-10
  • 打赏
  • 举报
回复
下面是调用存储过程的一段代码,不知道对你有没有用:
Connection conn = null;
ResultSet rs = null;
int result = 0;

conn = acx.getConnection();

try {
CallableStatement proc = conn.prepareCall(
"{call PRC_2502_AUCTION_ARTICLE_ADD(?, ?, ?, ?, ?, ?, ?, ?, ?) }");
proc.setString(1, article.getArticle_id());
proc.setString(2, article.getArticle_name());
proc.setString(3, article.getArticle_model());
proc.setString(4, article.getArticle_price());
proc.setString(5, article.getMax_bid_price());
proc.setString(6, article.getMin_bid_price());
proc.setString(7, article.getBegin_time());
proc.setString(8, article.getEnd_time());
proc.registerOutParameter(9, Types.INTEGER);

proc.execute();
int ret = proc.getInt(9);
System.out.print("The return of addArticle() is " + ret);
return ret; //0-³É¹¦, 1-ʧ°Ü
tom2005 2004-12-10
  • 打赏
  • 举报
回复
up
wq99 2004-12-10
  • 打赏
  • 举报
回复
楼主确定已经连上数据库?
evergreen 2004-12-10
  • 打赏
  • 举报
回复
proc.registerOutParameter(1, Types.OTHER);
确定不了输出参数类型?
有些JDBC是不支持OTHER类型的,最好使用对应的类型
spiritsl 2004-07-30
  • 打赏
  • 举报
回复
look jdbc
southline 2004-07-30
  • 打赏
  • 举报
回复
有没有人会?
555555555555555

81,092

社区成员

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

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