Thanks Craig and David. It was the differences in the nested setter property
names. BasicDataSource required a "driverClassName" and "username" in place
of the GenericDataSource ones of "driverClass" and "user".

I should have been able to find this in the documentation but somehow over
looked it.

Thanks again

Anthony

-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: November 22, 2002 2:56 PM
To: Struts Users Mailing List
Subject: Re: BasicDataSource data source usage.


On Fri, 22 Nov 2002, Anthony Mutiso 2 wrote:

> Date: Fri, 22 Nov 2002 13:47:04 -0700
> From: Anthony Mutiso 2 <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "Struts Mail List (E-mail)" <[EMAIL PROTECTED]>
> Subject: BasicDataSource data source usage.
>
> The struts javadoc page for GenericDataSource says to use BasicDataSource.
>
> When I configure a struts data-source with BasicDataSource, my struts 1.1
b2
> application fails work with a
>
> java.sql.SQLException: Cannot load JDBC driver class 'null'
>
> On the appplication startup
>
> While if I remove the "type" attribute all appears well.
>
> This dies
>   <data-source key="SiteCatalogDataSource"
> type="org.apache.commons.dbcp.BasicDataSource">
>
> This works
>   <data-source key="SiteCatalogDataSource">
>

Without seeing your nested property setter elements, it's impossible to
know for sure, but I'd bet that you didn't adjust the property names to
match.  For example, in DBCP the JDBC driver class is set by the
"driverClassName"  property, while for GenericDataSource it's
"driverClass".

> Why do I want a BasicDataSource? The docs implie that I can do it, and
> GenericDataSource's methods are all deprecated.
>

For backwards compatibility, GenericDataSource in 1.1 is just a wrapper
around BasicDataSource.  The wrapper adapts automatically to the property
name differences, so old 1.0 apps continue to work.

> I wanted to get the at the DriveClassName within the app to print out in
the
> logs the application configuration.
>
> Thanks
>
> Anthony
>

Craig


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

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

Reply via email to