日期:2014-05-18  浏览次数:20685 次

jsp中调用存储过程的指针参数
jsp中调用存储过程的指针参数,怎么调用啊,


我的老是出现java.sql.SQLException:   不支持的特性
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
oracle.jdbc.driver.OracleCallableStatement.setInt(OracleCallableStatement.java:1238)
org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement.setInt(DelegatingCallableStatement.java:206)
org.apache.jsp.PatrolMan.GrantAndMend_005fList_jsp._jspService(org.apache.jsp.PatrolMan.GrantAndMend_005fList_jsp:260)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
filters.CheckLoginTimoutFilter.doFilter(CheckLoginTimoutFilter.java:57)
filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)
大大救命啊我是这样调用的
Connection   conn=myDB.getConnection();
ResultSet   rs=   null;
CallableStatement   proc   =   null;
//oracle.jdbc.OracleCallableStatement   proc=null;
//proc   =   (oracle.jdbc.OracleCallableStatement)conn.prepareCall( "{   call   P_Pagination(?,?,?,?,?,?)   } ");  
proc   =   conn.prepareCall( "{   call   super.P_Pagination(?,?,?,?,?,?)   } ");  

proc.setInt( "Pindex ",   iPageNo);  
proc.setInt( "Psize ",iPageSize);
proc.setString( "Psql ",   sql);  
proc.registerOutParameter( "Pcount ",   oracle.jdbc.OracleTypes.INTEGER);
proc.registerOutParameter( "Prcount ",oracle.jdbc.OracleTypes.INTEGER);
proc.registerOutParameter( "v_cur ",oracle.jdbc.OracleTypes.CURSOR);    
proc.execute();            

rs=(ResultSet)proc.getObject( "6 ");

iRecordCount=proc.getInt( "Prcount ");
iPageCount=proc.getInt( "Pcount ");      
rs.next();


------解决方案--------------------
package com.hyq.src;

import java.sql.*;

import java.io.OutputStream;

import java.io.Writer;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import oracle.jdbc.driver.*;


public class TestProcedureTHREE {

public TestProcedureTHREE() {

}

public static void main(String[] args ){

String driver = "oracle.jdbc.driver.OracleDriver ";

String strUrl = "jdbc:oracle:thin:@127.0.0.1:1521:hyq ";

Statement stmt = null;

ResultSet rs = null;

Connection conn = null;


try {

Class.forName(driver);

conn = DriverManager.getConnection(strUrl, "hyq ", "hyq ");


CallableStatement proc = null;

proc = conn.prepareCall( "{ call hyq.testc(?) } ");

proc.registerOutPar