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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to