我的程序也出现了类似的错误,存储过程没有问题,就是java调用的时候错了,我用了以上的方法都没有解决。请同行们看一看。。

作者:用户 来源:互联网 浏览:276 次 时间:2016-06-03 16:09:36

我的程序也出现了类似的错误,存储过程没有问题,就是java调用的时候错了,我用了以上的方法都没有解决。请同行们看一看。。 - 摘要: createorreplaceprocedureproc_selOperator(nameinvarchar2,pwdinvarchar2,selTypeinvarchar2)ascnamevarch

问题描述

createorreplaceprocedureproc_selOperator(nameinvarchar2,pwdinvarchar2,selTypeinvarchar2)ascnamevarchar2(40);cpwdvarchar2(16);beginif(selType='IN_NAME')thenselectOname,Opwdintocname,cpwdfromoperatorwhereOname=name;elsif(selType='IN_NAME_PWD')thenselectOname,Opwdintocname,cpwdfromoperatorwhereOname=nameandOpwd=pwd;endif;end;我也遇到相同的问题了。。。都在么。。这个是我的存储过程,返回多个值。。java代码调用存储过程。。。publicstaticCollectionselOperator(Stringname,Stringpwd,OperatorSelTypeselType){//连接数据库Connectioncon=ConnectionManager.getConnection();CallableStatementcst=null;ResultSetrs=null;//建一个操作员列表Collection<Operator>opc=newArrayList<Operator>();try{Stringproc="{callproc_selOperator('"+name+"','"+pwd+"','"+selType+"')}";//取得操作员表数据cst=con.prepareCall(proc);rs=cst.executeQuery();while(rs.next()){Operatorop=newOperator();op.setName(rs.getString("Oname"));op.setPwd(rs.getString("Opwd"));opc.add(op);}}catch(SQLExceptionex){ex.printStackTrace();}finally{ConnectionManager.closeResultSet(rs);ConnectionManager.closeStatement(cst);ConnectionManager.closeConnection(con);}returnopc;}出现java.sql.SQLException:ORA-00900:invalidSQLstatementatoracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)atoracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)atoracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)atoracle.jdbc.driver.T4C8Odscrarr.receive(T4C8Odscrarr.java:203)atoracle.jdbc.driver.T4CCallableStatement.do_describe(T4CCallableStatement.java:604)atoracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:3047)atoracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1861)atoracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1559)atcn.waycool.contrl.DBWorker.selOperator(DBWorker.java:53)atcn.waycool.frame.Login.actionPerformed(Login.java:99)atjavax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)atjavax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)atjavax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)atjavax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)atjavax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)atjava.awt.Component.processMouseEvent(Component.java:5488)atjavax.swing.JComponent.processMouseEvent(JComponent.java:3093)atjava.awt.Component.processEvent(Component.java:5253)atjava.awt.Container.processEvent(Container.java:1966)atjava.awt.Component.dispatchEventImpl(Component.java:3955)atjava.awt.Container.dispatchEventImpl(Container.java:2024)atjava.awt.Component.dispatchEvent(Component.java:3803)atjava.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)atjava.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)atjava.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)atjava.awt.Container.dispatchEventImpl(Container.java:2010)atjava.awt.Window.dispatchEventImpl(Window.java:1766)atjava.awt.Component.dispatchEvent(Component.java:3803)atjava.awt.EventQueue.dispatchEvent(EventQueue.java:463)atjava.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)atjava.awt.EventDispatchThread.run(EventDispatchThread.java:110)
【云栖快讯】你想见的Java技术专家都在这了,向大佬提问,有问题必答  详情请点击
弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率

40+云计算产品,6个月免费体验

现在注册,免费体验40+云产品,及域名优惠!

云服务器9.9元/月,大学必备

热点导航