DB2 Connection pool in Glassfish
Well...
i already have copied files :db2jcc4.jar db2jcc.jar which I get from my db2 server. Now Im trying to make a connection pool in glassfish as a : javax.sql.DataSource with : Datasource class name: com.ibm.db2.jcc.DB2DataSource ... data in url, name and password are 100% correct because I can connect to that DB with standalone application. When all is configured and Im tr开发者_StackOverflowying to ping my server Ive getting this:
Ping Connection Pool for DB2ConnPool is Failed. Ping failed Exception - Connection could not be allocated because: [jcc][10389][12245][4.7.85] Niepowodzenie podczas ładowania biblioteki rodzimej db2jcct2, java.lang.UnsatisfiedLinkError: no db2jcct2 in java.library.path: ERRORCODE=-4472, SQLSTATE=null Please check the server.log for more details.
For all non-polish users : "Niepowodzenie podczas ładowania biblioteki rodzimej" is like: "Failure while loading library"
The answer already given by Tom is correct, and the solution is to add a "driverType = 4" in the "additional properties" of Glassfish's connection pool configuration page.
Here's a link to an article in spanish, but may be useful: http://www.unixlibre.org/articulos.jsp?cve=61
The driver is trying to load a native library called db2jcct2 - that will be in a file called db2jcct2.dll on Windows, or libdb2jcct2.so on unix. For some reason, it is not on the library search path.
So, do two things:
- Make sure you have the library in a directory somewhere
- Make sure you set the java.library.path system variable to include that directory
精彩评论