PDA

View Full Version : How to connect to MS sql server?



javartin
09-28-2003, 08:54 PM
How to connect to MS sql server?
Hi:
I tried to run the FoodMart example and everything worked just fine. However
,when I tried to write my own application using Mondrian, I got some problems.
1, I have a database named "bibtdb" which is in sql server.The user name is "btuser', password is "123".
2, my web.xml is
<context-param>
<param-name>connectString</param-name>
<param-value>Provider=mondrian;JdbcUser=btuser;JdbcPassword=123;Jdbc=jdbc:odbc:bibtdb;Catalog=/WEB-INF/queries/BillformFactCube.xml;JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver;</param-value>
</context-param>
3. I registerd my database using System DSN and SQL driver,and tested with user name "btuser' and password "123".
and I got the following error messsage from DOS prompt running Tomcat:
....................................
...................
Mondrian: loaded 0 system properties
Mondrian: JDBC driver sun.jdbc.odbc.JdbcOdbcDriver loaded successfully
mondrian.resource.ChainableRuntimeException: Internal error: Error while executi
ng query [select {[Measures].[TT_Total]} ON columns
from [Billform_Fact_Cube]
]
at mondrian.olap.MondrianResource.newInternal(MondrianResource.java:45)
at mondrian.olap.Util.newError(Util.java:445)
at mondrian.rolap.RolapConnection.execute(RolapConnection.java:257)
at mondrian.web.taglib.ResultCache.getResult(ResultCache.java:66)
at mondrian.web.taglib.ResultCache.getDOM(ResultCache.java:77)
at mondrian.web.taglib.TransformTag.doEndTag(TransformTag.java:56)
.............................
........................
at java.lang.Thread.run(Thread.java:536)
Caused by: java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server
]Invalid object name 'billform_fact'.
at mondrian.rolap.RolapUtil.executeQuery(RolapUtil.java:218)
at mondrian.rolap.agg.Segment.load(Segment.java:348)
... 48 more
caused by
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid ob
ject name 'billform_fact'.
at mondrian.rolap.RolapUtil.executeQuery(RolapUtil.java:218)
I also tried to play around with web.xml like
<param-value>Provider=mondrian;Jdbc=jdbc:odbc:sqlserver://martin_huang:1433/bibtdb?user=bibtdb&password=123;Catalog=/WEB-INF/queries/BillformFactCube.xml;JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver;</param-value>
or
<param-value>Provider=mondrian;Jdbc=jdbc:microsoft:sqlserver://martin_huang:1433;Catalog=/WEB-INF/queries/BillformFactCube.xml;JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver;</param-value>
but none of these worked.............
what's wrong here????
Thanx
Martin

ebengtso
09-29-2003, 05:09 AM
who is the owner of the table 'billform_fact' ?
Try to set it as dbo the owner, and verify if the user has the appropriate rights on it