PDA

View Full Version : Solution to connection problem with SQL Server 2005 by Sanjukta Samom, iCreate



sanzukta
08-19-2008, 03:20 AM
Solution by SANJUKTA SAMON, iCreate Softwares:

To connect the SQL server database with an instance name, incorporate the below in the web.xml file,

<!-- Connection String For SQL Server -->
<context-param>
<param-name>connectString</param-name>
<param-value>Provider=Mondrian;Jdbc=jdbc:sqlserver://172.16.1.3\saba_devl_vyasa_bizscore;jdbc.instanceN ame=ads;jdbc.username=sa;jdbc.password=Welcome1;Jd bcDrivers=com.microsoft.sqlserver.jdbc.SQLServerDr iver;Catalog=/WEB-INF/schema/bizscore.xml;</param-value>
</context-param>

The ads in the above string needs to be changed with the required instance name. The back-slash before the database name is very important. A forward slash will cause the connection to fail invoking unknown host exception.

ygiriyap
08-27-2008, 03:33 AM
The below string a tested connection string to connect from mondrian to mssql 2005.
This tells how to provide a connection string having host,port,instanceName,databaseName and DataSourceChangeListener.


Provider=Mondrian;Jdbc=jdbc:sqlserver://<host>\<instanceName>:<port>;jdbc.databaseName=<databaseName>;jdbc.username=<userName>;jdbc.password=<password>;JdbcDrivers=com.microsoft.sqlserver.jdbc.SQLServerDriver;Catalog=/WEB-INF/schema/bizscore.xml;DataSourceChangeListener=<fully qualified name of the class implementing DataSourceChangeListner interface>;


Example:-
Provider=Mondrian;Jdbc=jdbc:sqlserver://127.0.0.1\myinstance:1433;jdbc.databaseName=mydatabase;jdbc.username=sa;jdbc.password=tiger;JdbcDrivers=com.microsoft.sqlserver.jdbc.SQLServerDriver;Catalog=/WEB-INF/schema/bizscore.xml;DataSourceChangeListener=com.mondrian.MyDataSourceChangeListenerImpl;