当前位置: 代码迷 >> Java Web开发 >> com.microsoft.sqlserver.jdbc.SQLServerException: 索引 1 超出范围。该怎么处理
  详细解决方案

com.microsoft.sqlserver.jdbc.SQLServerException: 索引 1 超出范围。该怎么处理

热度:1322   发布时间:2016-04-14 21:10:56
com.microsoft.sqlserver.jdbc.SQLServerException: 索引 1 超出范围。
com.microsoft.sqlserver.jdbc.SQLServerException: 索引 1 超出范围。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setterGetParam(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(Unknown Source)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:169)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:169)
at dao.DBHelperOracle.setValues(DBHelperOracle.java:141)
at dao.DBHelperOracle.executeQueryForSQLById(DBHelperOracle.java:323)
at dao.VideonewsDao.getNextBean(VideonewsDao.java:226)
at service.VideonewsService.getNextBean(VideonewsService.java:141)
at servlet.web.GotoVideoInfoServlet.doGet(GotoVideoInfoServlet.java:47)
at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at dispatcher.SimpleDispatcherServlet.doGet(SimpleDispatcherServlet.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at dispatcher.Encoding.doFilter(Encoding.java:22)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
------解决思路----------------------
at dao.DBHelperOracle.setValues(DBHelperOracle.java:141)
这一行,一般的问题是preparedStatment.setObject(0,obj) ,不是1,他是从0开始的
------解决思路----------------------
dao.DBHelperOracle.setValues这个是楼主自己写的函数吧?
贴一下函数的源码。函数中调用的相关子函数源码(你自己写的)也贴一下
  相关解决方案