IDependOn-Set: 1
IDependOn-Set: 119
IDependOn-Set: 2
IDependOn-Set: 260
IDependOn-Set: 261
IDependOn-Set: 270
LastModifiedSecs: 933012949
Parent: 119
SequenceNumber: 2
Title: -Djdbc.driver=... with servlets
Part: 0
Author-Set: jon@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 933012949
Type: monospaced
Lines: 38
----------
From: "Craig R. McClanahan" <cmcclanahan@mytownnet.com>
To: Java Apache Users <java-apache-users@list.working-dogs.com>
Subject: Re: -Djdbc.driver=... with servlets
Date: Sun, Jul 25, 1999, 9:51 PM

Jim Richards wrote:

>
> I can get my Java Servlet to run if I use a
>
>         Class.forName("prostgresql.Driver");
>
> line before I do the
>
>         DriverManager.getConnection(urs, user, passwd);
>
> But I'd prefer not to have to do that so the
> Servlet is jdbc driver independant. I know if I run
> a Java programme from the command line I can use
>
>         -Djdbc.driver=postgresql.Driver
>
> on the command line, and I can set it various .properties
> files, but I can't work out the settings in the
> jserv.properities file for the equivalent.
>

In the jserv.properties file, add a line like this:

    wrapper.bin.parameters=-Djdbc.driver=postgresql.Driver

You will also find that most connection pool implementations let you 
specify the name
of the JDBC driver class as an initialization parameter, so you can maintain source
code independence from a particular driver.

Craig McClanahan
EndPart: 0
