You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Johnson, Jay" <Ja...@dpsk12.org> on 2005/01/05 22:53:27 UTC

Connection Pooling with Tomcat 4.1 and SQL Server 2000

I am trying to establish a connection pool in Tomcat 4.1 to SQL Server
2000.  Looking at the SQL Server trace utility, it appears Tomcat
connects with the correct username/password and then the following
exception is thrown:

 

java.lang.UnsupportedOperationException at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSourc
e.java:161).
 
I have taken the following steps:
 
1)        Moved the driver jar files to /common/lib/
2)        Modified the Server.xml file
3)        Modified the web.xml file of the application
 
Here is my Server.xml entry:
 
<DefaultContext>
<Resource name="jdbc/test" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/test">
<parameter>
<name>driverClassName</name>
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:microsoft:sqlserver://localhost:1433</value>
</parameter>
<parameter>
<name>username</name>
<value>jay</value>
</parameter>
<parameter>
<name>password</name>
<value>jay</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>100</value>
</parameter>
</ResourceParams>
</DefaultContext>
 
Here is my entry in the web.xml file:
 
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth> 
</resource-ref>
 
Are any additional entries needed?  Any help would be greatly
appreciated!

 

Thanks,

Jay Johnson


Re: Connection Pooling with Tomcat 4.1 and SQL Server 2000

Posted by Friedrich Gonzalez <so...@suiche7b.com.ve>.
Everything you did with the driver,server.xml,web.xml is ok.
But it sounds like your driver of sql server 2000 doesnt support 
connection pooling ...
did you tried to connect without the connection pool?
i also recommend going to tomcat 5... i had a couple of issues with 
connection pooling in tomcat 4 with db2 so i went to tomcat 5.
now everything is just better.

Johnson, Jay escribió:

>I am trying to establish a connection pool in Tomcat 4.1 to SQL Server
>2000.  Looking at the SQL Server trace utility, it appears Tomcat
>connects with the correct username/password and then the following
>exception is thrown:
>
> 
>
>java.lang.UnsupportedOperationException at
>org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSourc
>e.java:161).
> 
>I have taken the following steps:
> 
>1)        Moved the driver jar files to /common/lib/
>2)        Modified the Server.xml file
>3)        Modified the web.xml file of the application
> 
>Here is my Server.xml entry:
> 
><DefaultContext>
><Resource name="jdbc/test" auth="Container"
>type="javax.sql.DataSource"/>
><ResourceParams name="jdbc/test">
><parameter>
><name>driverClassName</name>
><value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
></parameter>
><parameter>
><name>url</name>
><value>jdbc:microsoft:sqlserver://localhost:1433</value>
></parameter>
><parameter>
><name>username</name>
><value>jay</value>
></parameter>
><parameter>
><name>password</name>
><value>jay</value>
></parameter>
><parameter>
><name>maxActive</name>
><value>20</value>
></parameter>
><parameter>
><name>maxIdle</name>
><value>10</value>
></parameter>
><parameter>
><name>maxWait</name>
><value>100</value>
></parameter>
></ResourceParams>
></DefaultContext>
> 
>Here is my entry in the web.xml file:
> 
><resource-ref>
><description>DB Connection</description>
><res-ref-name>jdbc/test</res-ref-name>
><res-type>javax.sql.DataSource</res-type>
><res-auth>Container</res-auth> 
></resource-ref>
> 
>Are any additional entries needed?  Any help would be greatly
>appreciated!
>
> 
>
>Thanks,
>
>Jay Johnson
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org