Hi Claire,
We are successfully connecting to a Microsoft SQL Server 2000 using the
type 4 JDBC drivers. However, we do not use DBCP, but rather the
DataSource implementation provided by Microsoft. Here is the configuration
we use (this is taken from an internal configuration file that we use to
create the DataSource's from an AXIS handler for our web services, not
struts-config.xml, but the same properties should work)
<datasource name="peregrine" type
="com.microsoft.jdbcx.sqlserver.SQLServerDataSource">
<serverName>XXX</serverName>
<databaseName>Peregrine</databaseName>
<portNumber>1433</portNumber>
<loginTimeout>60</loginTimeout>
<user>XXX</user>
<password>XXX</password>
</datasource>
Also, if you need to connect to the same database across multiple web apps,
you want to look into using JNDI instead of the struts-config.xml file.
HTH,
Ian
"Claire Wall"
<[EMAIL PROTECTED] To: "Struts Users Mailing List"
<[EMAIL PROTECTED]>
tosys.com> cc:
Subject: microsoft sqlserver driver &
struts
02/27/2004 05:34
AM
Please respond
to "Struts Users
Mailing List"
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
This transmission may contain information that is privileged, confidential and/or
exempt from disclosure under applicable law. If you are not the intended recipient,
you are hereby notified that any disclosure, copying, distribution, or use of the
information contained herein (including any reliance thereon) is STRICTLY PROHIBITED.
If you received this transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard copy format. Thank
you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]