PDA

View Full Version : Use MS JDBC Driver occur error



frank_twtp
10-14-2003, 07:07 PM
First, I use MS SQL Server Northwind Database, Second, my fact table is a VIEW.
When I use ms jdbc driver occur error like this:
org.apache.jasper.JasperException: Internal error: while counting members of level '[Category].[CATEGORY]'; sql=[select count(*) as "c0" from (select distinct "WHO_BUY"."CATEGORYID" as "c0" from "WHO_BUY" as "WHO_BUY") as "init"]
org.apache.jasper.JasperException: Internal error: while counting members of level '[Category].[CATEGORY]'; sql=[select count(*) as "c0" from (select distinct "WHO_BUY"."CATEGORYID" as "c0" from "WHO_BUY" as "WHO_BUY") as "init"] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:111) at com.tonbeller.wcf.controller.RequestSynchronizer.handleRequest(RequestSynchronizer.java:102) at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:137) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619) at java.lang.Thread.run(Thread.java:534)

jhyde
10-23-2003, 04:59 AM
I suspect the problem is that object names are being quoted using double quotes (" ... ") rather than brackets ([ ... ]).
What is the class name of the JDBC driver? What version of the driver are you using?
Does the same example work if you use the JDBC-ODBC bridge (a connect string like 'jdbc:odbc:Northwind', driver class 'sun.jdbc.odbc.JdbcOdbcDriver')?

frank_twtp
10-23-2003, 04:06 PM
1.I use the jp tag(mondrianQuery) like this:
<jp:mondrianQuery id="query01" jdbcDriver="com.microsoft.jdbc.sqlserver.SQLServerDriver" jdbcUrl="jdbc:microsoft:sqlserver://myServer:1433;DatabaseName=northwind" jdbcUser="sa" jdbcPassword="1234" catalogUri="/WEB-INF/queries/who_buy.xml">
2.When I use JDBC-ODBC bridge to run the same sample, it work.
3.Now, I'll try your way....thanks for your help!

hkls
11-27-2003, 03:28 PM
I used JDBC-ODBC bridge to join MSSQL, but the resultset.getobject() return null, MSSQL 2000 is simplechinese version .
and use
<jp:mondrianQuery id="query01" jdbcDriver="com.microsoft.jdbc.sqlserver.SQLServerDriver" jdbcUrl="jdbc:microsoft:sqlserver\://myServer:1433;DatabaseName=northwind" jdbcUser="sa" jdbcPassword="1234" catalogUri="/WEB-INF/queries/who_buy.xml">
error:
javax.servlet.ServletException: java.sql.SQLException: No suitable driver at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:859) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:795) at org.apache.jsp.testpage_jsp._jspService(testpage_jsp.java:224) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:108) at com.tonbeller.wcf.controller.RequestSynchronizer.handleRequest(RequestSynchronizer.java:99) at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:134) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:209) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:736) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:542) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:578) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666) at java.lang.Thread.run(Thread.java:536)

hkls
11-27-2003, 03:34 PM
and
use WORKBENCH to test
jdbcDriver="com.microsoft.jdbc.sqlserver.SQLServerDriver" jdbcUrl="jdbc:microsoft:sqlserver\://myServer:1433;DatabaseName=northwind"
succeed,
WHY?!!!

hkls
11-27-2003, 05:15 PM
I used MSSQL driver to solve it,ok
"\"jdbc:microsoft:sqlserver\://myServer:1433;DatabaseName=northwind\""
but,JDBC-ODBC bridge can not