Agent DB2 connection

I am currently trying to connect to a DB2 database from an agent. The first time the agent runs the connection is successful. After the first time, each time the agent runs i get the following error:

java.sql.SQLException: java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\SQLLIB\bin\db2jdbc.dll already loaded in another classloader

at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)

The db2java.zip is set in the agent properties NOT in notes.ini. The connection is set up in the following way:

url = “jdbc:db2:cart”;

Class.forName(“COM.ibm.db2.jdbc.app.DB2Driver”).newInstance();

con = DriverManager.getConnection( url,“test”,“test”);

Anyone got any ideas on how to fix this?

Subject: Agent DB2 connection SOLUTION

I wish someone had posted a solution sooner, particularly those who responded in other threads with simply, “ok, got it working”

I added SQLLIB\Java\db2java.zip to JavaUserClasses= in notes.ini, and got a different error message, which copying db2jdbc.dll from SQLLIB\bin to Notes resolved. It probably would have worked if I put SQLIB\bin in the Path env var as well.

See further discussion at http://www.laneyconsulting.com/web/blog.nsf/plinks/NLAY-5VKHTC