CallableStatement cs=con.prepareStatement("{call sp_jsptest(?)}");
 cs.setInt (1, telenumber);
ResultSet rs=cs.excuteQuery();

解决方案 »

  1.   

    按楼上说的,因我的telenumber是字符型的,所以用以下的
    String telenumber=request.getParameter("numtimes");
    CallableStatement cs=Con.prepareStatement("{call sp_jsptest(?)}");
     cs.setString(1, telenumber);
    ResultSet RS=cs.excuteQuery();
    但执行提示如下:Incompatible type for declaration. Explicit cast needed to convert java.sql.PreparedStatement to java.sql.CallableStatement.
                    CallableStatement cs=Con.prepareStatement("{call sp_jsptest(?)}");Method excuteQuery() not found in interface java.sql.CallableStatement.
                    ResultSet RS=cs.excuteQuery();
    现在该如何改?