struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <markl...@libero.it>
Subject Re: Oracle DataSource Tips
Date Tue, 17 Dec 2002 09:09:57 GMT
Hello

I'm using oracle as my datsource as well, I haven't had this problem but
that in my earlier posting..

So who do you reference the datasource specifed in config.xml in business
logic classes. The docs recommend this seperation but provide no clear way
of doing this, am i missing something?

Many thanks mark

On 16-12-2002 22:01, "Bradley G Smith" <bgsmith01@fs.fed.us> wrote:

> Since it took me several hours to catch this bug, I thought I might pass it
> along to anyone using Oracle as a datasource for the Struts application.
> 
> The OracleDatSource and OraclePooledConnectionDataSource classes use
> standard Bean naming conventions for getters and setters. The url property,
> however, uses setURL and getURL for the setter and getter respectively.
> Therefore, the set-property element in the datasource clause should be
> <set-property property="URL" value="jdbc:oracle: ..." /> instead of
> <set-property property="url" value="jdbc:oracle: ..." />.
> 
> A valid datasource definition that is working for me is:
> 
> <data-sources>
>  <data-source key="DB_KEY"
>                             type
> ="oracle.jdbc.pool.OracleConnectionPoolDataSource">
>     <set-property property="password"
>                                value="valid_pass" />
>     <set-property property="user"
>                                value="valid_user" />
>     <set-property property="description"
>                                value="Application Data Resource" />
>     <set-property property="URL"
>                                 value="jdbc:oracle:thin:
> @xxx.xxx.xxx.xxx:1521:a" />
>  <data-source>
> </data-sources>
> 
> The xxx.xxx.xxx.xxx value is an IP or resolvable hostname for the oracle
> server. 1521 is the port to use. "a" is the instance name for the database.
> The key is an arbitrary string.
> 
> If you choose instead to use the default connection pool from Struts (via
> the Commons database package) then the ping that works for Oracle is
> "select 1 from dual". Dual is a virtual table in every Oracle instance.
> 
> Brad
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message