这个语句在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); |
这个问题怎么解决呀? 急急急! 谢谢各位大侠!