users@glassfish.java.net

CLOB for LONG String values and OracleConnection from a DataSource

From: <glassfish_at_javadesktop.org>
Date: Tue, 01 Jul 2008 04:11:11 PDT

Hi

I need to get an OracleConnection in a GF Java module to create a CLOB in order to be able to store large objects ( > 4K bytes). The problem is I cannot get an OracleDataSource to get an OracleConnection. The result of the JNDI lookup is always a com.sun....DataSource.

Does anybody know how to do that?

I've created a JDBC resource and Connection pool in this way:
<resources>
    <jdbc-resource enabled="true" jndi-name="jdbc/cat" object-type="user" pool-name="catPool">
        <description/>
    </jdbc-resource>
    <jdbc-connection-pool allow-non-component-callers="false"
    associate-with-thread="false" connection-creation-retry-attempts="0"
    connection-creation-retry-interval-in-seconds="10"
    connection-leak-reclaim="false"
    connection-leak-timeout-in-seconds="0"
    connection-validation-method="auto-commit"
    datasource-classname="oracle.jdbc.pool.OracleDataSource"
    fail-all-connections="false" idle-timeout-in-seconds="300"
    is-connection-validation-required="false"
    is-isolation-level-guaranteed="true" lazy-connection-association="false"
    lazy-connection-enlistment="false" match-connections="false"
    max-connection-usage-count="0" max-pool-size="32"
    max-wait-time-in-millis="60000" name="catPool"
    non-transactional-connections="false" pool-resize-quantity="2"
    res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1"
    steady-pool-size="8" validate-atmost-once-period-in-seconds="0"
    wrap-jdbc-objects="false">
        <property name="URL" value="jdbc:oracle:thin:@xxxx.xx:1521:RR12"/>
        <property name="User" value="myuser"/>
        <property name="Password" value="mypasswd"/>
    </jdbc-connection-pool>
</resources>

I've tested the three possible res-types: javax.sql.DataSource, javax.sql.XADataSource and javax.sql.ConnectionPoolDataSource.
[Message sent by forum member 'aperezymadrid' (aperezymadrid)]

http://forums.java.net/jive/thread.jspa?messageID=283599