Hi,
I am using the same datasource configuration as you do:
<data-source type="org.apache.commons.dbcp.BasicDataSource" key="BkEdDbFls">
<set-property property="driverClassName"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<set-property property="url"
value="jdbc:microsoft:sqlserver://**.***.***.***:1433;DatabaseName=tesstdb"
/>
<set-property property="username"
value="***" />
<set-property property="password"
value="***" />
<set-property property="maxActive"
value="10" />
<set-property property="maxWait"
value="5000" />
<set-property property="defaultAutoCommit"
value="true" />
<set-property property="defaultReadOnly"
value="false" />
</data-source>
and in the code ,
DataSource dataSource = (DataSource)
context.getAttribute("BkEdDbFls");
Hope this helps. Can u give me what error message u r receiving.
Srikanth.
-----Original Message-----
From: Claire Wall [mailto:[EMAIL PROTECTED]
Sent: Friday, February 27, 2004 5:34 AM
To: Struts Users Mailing List
Subject: microsoft sqlserver driver & struts
Hi,
I am trying to use microsoft's jdbc driver with my struts application, but
to no avail. Here is my datasource definition:
<data-source key="DB" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="description" value="My SqlServer pool"/>
<set-property property="driverClassName"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<set-property property="url"
value="jdbc:microsoft:sqlserver://SERVERNAME:1433;DatabaseName=DBNAME"/>
<set-property property="username" value="xxx"/>
<set-property property="password" value="xxx"/>
<set-property property="maxActive" value="20"/>
<set-property property="maxCount" value="20"/>
<set-property property="minCount" value="2"/>
<set-property property="maxWait" value="5000"/>
<set-property property="defaultAutoCommit" value="false"/>
<set-property property="defaultReadOnly" value="false"/>
</data-source>
I have the required jars located in the WEB-INF/lib of my application which
is running on Tomcat 4.1.29. When i try to connect to the database using
this driver from a test class, it connects no problem so i know that the url
and driver class name are correct. So the problem must be the type of
DataSource which I am to use. Does anybody know which datasource to use with
Microsoft's sqlserver driver? I tried using the DataSource that is in the
mssqlserver jar but this didnt work either.
The error that I get is an Invalid DataSource.
Any help would be really appreciated!
Thanks
Claire
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]