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