users@glassfish.java.net

Re: glassfish raises exception while creating connection to oracle

From: <glassfish_at_javadesktop.org>
Date: Mon, 29 Jun 2009 23:44:19 PDT

Thanks for your reply.
I am using ojdbc6.jar which seems the most suitable driver and replies to my needs.
ojdbc6.jar (1,988,051 bytes) - Classes for use with JDK 1.6. It contains the JDBC driver classes except classes for NLS support in Oracle Object and Collection types.

Here is my connection pool part from domain.xml

<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.xa.client.OracleXADataSource" fail-all-connections="false" idle-timeout-in-seconds="30000" is-connection-validation-required="false" is-isolation-level-guaranteed="false" 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="6000000" name="jLinDaPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.XADataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
  <property name="DataSourceName" value="OracleXADataSource" />
  <property name="ImplicitCachingEnabled" value="false" />
  <property name="NetworkProtocol" value="tcp" />
  <property name="DatabaseName" value="orclEN" />
  <property name="Password" value="mypassword" />
  <property name="NativeXA" value="false" />
  <property name="User" value="myusername" />
  <property name="ExplicitCachingEnabled" value="false" />
  <property name="ServiceName" value="orclEN" />
  <property name="MaxStatements" value="100000" />
  <property name="LoginTimeout" value="10000" />
  <property name="PortNumber" value="0" />
  <property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST =dbserver)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orclEn )))" />
  <property name="ServerName" value="dbserver" />
  </jdbc-connection-pool>


and here is a reduced version of my dbconnect class.
    public static Connection ora;
    private DataSource ds;
    private Context ic;

public dbConnect() {
        try {
            ic = new InitialContext();
            ds = (DataSource) ic.lookup("jdbc/jLinDa");
            ora = ds.getConnection();
        } catch (Exception ex) {
                    //
        }
    }


Glassfish-server has two network cards which is connected to internal network with ip (10.10.1.235) and the other network card is connected to another network which replies to my shops with ip(192.168.5.54) and the client computers adress is (192.168.5.xx). I think the rest is enough clear. I have a jnlp file and my application perfectly installs to client machine but all the problems start when connecting to db.

Thanks.
[Message sent by forum member 'bornoz' (bornoz)]

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