| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 973 人关注过本帖
标题:这个语句在Oracle中能查出结果,放在jsp里就出错,怎么回事?帮忙看看!
取消只看楼主 加入收藏
的的喀喀
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-4-30
收藏
 问题点数:0 回复次数: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 语句 结果 
2005-04-30 17:36
快速回复:这个语句在Oracle中能查出结果,放在jsp里就出错,怎么回事?帮忙看看 ...
数据加载中...
 
   



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

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