当前位置: 代码迷 >> Java Web开发 >> 这个语句在Oracle中能查出结果,放在jsp里就出错,怎么回事?帮忙看看!
  详细解决方案

这个语句在Oracle中能查出结果,放在jsp里就出错,怎么回事?帮忙看看!

热度:509   发布时间:2005-04-30 17:36:00.0
这个语句在Oracle中能查出结果,放在jsp里就出错,怎么回事?帮忙看看!

sql = "SELECT DM_YX.YX_QC,KC_XKQK.XKQK_KXH,KC_KC.KC_KCM,JS_JSXX.JSXX_XM,KC_KC.KC_XS FROM KC_XKQK, KC_KC,JS_JSXX,DM_YX WHERE (KC_XKQK.KC_KCH = KC_KC.KC_KCH) AND (KC_XKQK.JSXX_JSH = JS_JSXX.JSXX_JSH) AND ((SUBSTR( JS_JSXX.JSXX_JSH,0,2) = DM_YX.YX_DM) AND (KC_XKQK.JSLX_DM = '002'))"; JSP 错误:


请求 URI:/ychao/test.jsp

异常错误:

oracle.jsp.provider.JspCompileException: 

编译时出现错误:d:\oracle\ora92\apache\apache\htdocs\_pages\_ychao\_test.java

Line #Error

77

Incompatible type for =. Can't convert java.lang.String to java.sql.Statement. sql = "SELECT DM_YX.YX_QC,KC_XKQK.XKQK_KXH,KC_KC.KC_KCM,JS_JSXX.JSXX_XM,KC_KC.KC_XS FROM KC_XKQK, KC_KC,JS_JSXX,DM_YX WHERE (KC_XKQK.KC_KCH = KC_KC.KC_KCH) AND (KC_XKQK.JSXX_JSH = JS_JSXX.JSXX_JSH) AND ((SUBSTR( JS_JSXX.JSXX_JSH,0,2) = DM_YX.YX_DM) AND (KC_XKQK.JSLX_DM = '002'))";

79

Incompatible type for method. Can't convert java.sql.Statement to java.lang.String. rs = sql.executeQuery(sql);
at oracle.jsp.app.JspJavacCompiler.compile(JspJavacCompiler.java) at oracle.jsp.app.JspAppLoader.reloadPage(JspAppLoader.java) at oracle.jsp.app.JspAppLoader.loadPage(JspAppLoader.java) at oracle.jsp.app.JspAppLoader.getPage(JspAppLoader.java) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java) at oracle.jsp.JspServlet.doDispatch(JspServlet.java) at oracle.jsp.JspServlet.internalService(JspServlet.java) at oracle.jsp.JspServlet.service(JspServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:484)


这个问题怎么解决呀? 急急急! 谢谢各位大侠!
搜索更多相关主题的帖子: Oracle  中能  jsp  语句  结果  

----------------解决方案--------------------------------------------------------
我这里怎么看不清楚呀
我记得我不是近视眼呀
不过我看到了你79行的错误好象是类型不匹配哟
----------------解决方案--------------------------------------------------------
  相关解决方案