-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

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




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to