You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anthony Mutiso 2 <an...@utilitynet.net> on 2002/11/22 21:47:04 UTC

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

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

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

Thanks

Anthony

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: BasicDataSource data source usage.

Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Fri, 22 Nov 2002, Anthony Mutiso 2 wrote:

> Date: Fri, 22 Nov 2002 13:47:04 -0700
> From: Anthony Mutiso 2 <an...@utilitynet.net>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: "Struts Mail List (E-mail)" <st...@jakarta.apache.org>
> 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>