简体   繁体   English

Glassfish中的DB2连接池

[英]DB2 Connection pool in Glassfish

Well... 好...

i already have copied files : db2jcc4.jar db2jcc.jar which I get from my db2 server. 我已经复制了文件: db2jcc4.jar db2jcc.jar ,该文件是从db2服务器获得的。 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. 现在我试图在glassfish中建立一个连接池,使其成为: javax.sql.DataSource数据源类名称为:com.ibm.db2.jcc.DB2DataSource ... url,名称和密码中的数据都是100%正确的,因为我可以使用独立应用程序连接到该数据库。 When all is configured and Im trying to ping my server Ive getting this: 当所有配置完成后,我试图对服务器执行ping操作,我已经收到了:

Ping Connection Pool for DB2ConnPool is Failed. DB2ConnPool的Ping连接池失败。 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. Ping失败异常-无法分配连接,原因是:[jcc] [10389] [12245] [4.7.85] 4472,SQLSTATE = null请检查server.log以获取更多详细信息。

For all non-polish users : "Niepowodzenie podczas ładowania biblioteki rodzimej" is like: "Failure while loading library" 对于所有非波兰用户:“ Niepowodzenie podczasładowaniabiblioteki rodzimej”就像:“加载库失败”

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. Tom已经给出的答案是正确的,解决方案是在Glassfish的连接池配置页面的“其他属性”中添加“ driverType = 4”。

Here's a link to an article in spanish, but may be useful: http://www.unixlibre.org/articulos.jsp?cve=61 这是西班牙语文章的链接,但可能有用: 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. 驱动程序正在尝试加载一个名为db2jcct2的本机库-该库将在Windows上名为db2jcct2.dll的文件中,或者在unix上为libdb2jcct2.so的文件中。 For some reason, it is not on the library search path. 由于某种原因,它不在库搜索路径上。

So, do two things: 因此,请执行以下两项操作:

  1. Make sure you have the library in a directory somewhere 确保库在某个目录中
  2. Make sure you set the java.library.path system variable to include that directory 确保设置java.library.path系统变量以包含该目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM