users@glassfish.java.net

Re: Another database - another problem

From: Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 22 Aug 2007 17:17:31 +0530

1. You should use PATH instead of LD_LIBRARY_PATH on Windows.

2. Instead of setting PATH or LD_..., I suggest you put your driver jars
in domains\domain1\lib\ext and the associated native libraries (dlls) in
domains\domain1\lib\ext\x86. Restart the server.

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> After I solved the problem with the informix-db, I try to use glassfish with out mainframe-db. Therefore I wrote a test-ds-programm, which runs very well:
> private void testDatasourceDB2(){
> Connection con = null;
> try {
> com.ibm.db2.jcc.DB2DataSource ds = new com.ibm.db2.jcc.DB2DataSource();
> ds.setUser("b270308");
> ds.setPassword("pass");
> ds.setDatabaseName("ldbeg");
> ds.setDeferPrepares(false);
> con = ds.getConnection();
> System.out.println("Datasource und Connection erzeugt: " + ds.toString());
> } catch (SQLException ex) {
> ex.printStackTrace();
> } finally{
> if (con != null){
> try {
> con.close();
> } catch (SQLException ex) {
> ex.printStackTrace();
> }
> }
> }
> }
>
> Now, I try to configure a datasource within glassfish:
>
> <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="com.ibm.db2.jcc.DB2DataSource" fail-all-connections="false" idle-timeout-in-seconds="300" 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="60000" name="DB2Pool" 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">
> <description>DB2 Mainframe</description>
> <property name="user" value="b270308"/>
> <property name="password" value="pass"/>
> <property name="databaseName" value="ldbeg"/>
> <property name="deferPrepares" value="false"/>
> </jdbc-connection-pool>
>
> But: I got an exception:
>
> com.ibm.db2.jcc.a.SqlException: Failure in loading T2 native library db2jcct2
> at com.ibm.db2.jcc.t2.a.a(a.java:31)
> at com.ibm.db2.jcc.t2.T2Configuration.<clinit>(T2Configuration.java:74)
> at com.ibm.db2.jcc.DB2DataSource.getSimpleConnection(DB2DataSource.java:96)
> at com.ibm.db2.jcc.DB2DataSource.getConnection(DB2DataSource.java:65)
> at com.ibm.db2.jcc.DB2DataSource.getConnection(DB2DataSource.java:47)
> at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:107)
> at com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl.getUnpooledConnection(ConnectorConnectionPoolAdminServiceImpl.java:1220)
> at com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl.testConnectionPool(ConnectorConnectionPoolAdminServiceImpl.java:551)
> at com.sun.enterprise.connectors.ConnectorRuntime.testConnectionPool(ConnectorRuntime.java:499)
> at com.sun.enterprise.admin.mbeans.ResourcesMBean.pingConnectionPool(ResourcesMBean.java:2339)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>
> I tryed to set the missing env-vars in the start-script:
> set LD_LIBRARY_PATH=C:\Programme\IBM\DB2\SQLLIB;D:\home\270308\prg\glassfish\lib
> set VWSPATH=C:\Programme\IBM\DB2\SQLLIB
> set THREADS_FLAG=native
>
> but without success.
>
> Is there somebody, who can help me?
>
> Peter
> [Message sent by forum member 'pecabo' (pecabo)]
>
> http://forums.java.net/jive/thread.jspa?messageID=231980
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>