标题:这个语句在Oracle中能查出结果,放在jsp里就出错,怎么回事?帮忙看看!
只看楼主
的的喀喀
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-4-30
 问题点数:0 回复次数:1 
这个语句在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 语句 结果 
2005-04-30 17:36
疯子java
Rank: 4
等 级:贵宾
威 望:13
帖 子:328
专家分:0
注 册:2004-9-19
得分:0 
我这里怎么看不清楚呀
我记得我不是近视眼呀
不过我看到了你79行的错误好象是类型不匹配哟

疯言疯语 疯部可及 ---世界法第1章第1节第1条规定 此人由于说话太过于疯!!!其余人等切不可与其交谈! 此人由于说话太过于疯!!!此人的话100%的不能相信
2005-05-05 19:46



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-17113-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020777 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved