Ian,

This is the way I tried first as it seemed most logical to use the
SQLServerDataSource type from the mssqlserver.jar but this doesnt work for
me. The only one that made some progress was the
com.microsoft.jdbcx.base.BaseDataSource but then this threw some strange
error which said:

java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
 at com.microsoft.jdbcx.base.BaseDataSource.setLogWriter(Unknown Source)

I've had a look into this but I don't see why this error should be occuring.
Maybe there's something wrong I have done with where I've put the jars.. I
have three jars: mssqlserver.jar, msbase.jar and msutil.jar. the last two
look to be pretty similiar with regards to what they contain. I was
wondering whether this could be causing conflicts or something.

As I said, i can connect fine to the datasource from a test class but going
via struts is causing this Invalid DataSource problem.

Claire

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, February 27, 2004 3:02 PM
Subject: Re: microsoft sqlserver driver & struts


> 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]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to