On Mon, 06 Oct 2003 14:55, Josh G wrote:

> Unfortunately it's already in a specific context as far as I can tell :(
> I've downloaded the source to dbcp and it seems it's throwing a
> SQLException on DriverManager.getDriver(url) but there's no reason I can
> see that it should, as the url it returns worked just fine when we were
> doing it the old fashioned way, the only difference is we called
> getConnection instead of calling getdriver and doing things seperately
> like dbcp does. Anybody know why getDriver would throw a SQLException
> where getConnection would not?

There are a few other issues as well. There is a new and old way of doing the 
connection parameters. The old way had a parameter called 'user' - which has 
been changed to 'username' - and 'url' replaced 'Driver'. If you are using 
DBCP then you need to use 'username' and 'url'.

Below is an example that I use myself (with some changes to protect the 
innocent):

        <DefaultContext debug="0" reloadabe="true">        

                <Resource name="jdbc/foo" 
                        auth="Container"
                        type="javax.sql.DataSource"/>

                <ResourceParams name="jdbc/foo">
                
                <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                </parameter>

                <parameter>
                        <name>maxActive</name>
                        <value>100</value>
                </parameter>

                <parameter>
                        <name>maxIdle</name>
                        <value>30</value>
                </parameter>

                <parameter>
                        <name>maxWait</name>
                        <value>10000</value>
                </parameter>
                
                <parameter>
                        <name>validationQuery</name>
                        <value>SELECT 1;</value>
                </parameter>

                <parameter>
                        <name>removeAbandoned</name>
                        <value>true</value>
                </parameter>

                <parameter>
                        <name>removeAbandonedTimeout</name>
                        <value>500</value>
                </parameter>

                <parameter>
                        <name>username</name>
                        <value>bill</value>
                </parameter>

                <parameter>
                        <name>password</name>
                        <value>zap</value>
                </parameter>

                <parameter>
                        <name>driverClassName</name>
                        <value>org.postgresql.Driver</value>
                </parameter>

                <parameter>
                        <name>url</name>
                        <value>jdbc:postgresql://localhost/foo</value>
                </parameter>

        </ResourceParams>
        </DefaultContext>

> This is really starting to get ridiculous, I've spent way too long
> trying to make this work, and I'm pulling my hair out so to speak.

I know how you feel. Trying to get this working under 4.1.27 was impossible 
due to the afforementioned bug - so I'm still on 4.0.4. I spent two or three 
days trying everything. Wish I had time to get in and debug it - 

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

Reply via email to