views:

464

answers:

2

Hi,

I'm trying to connect to the AS400 database DB2 from a Java application hosted in JBoss application server. But, I'm getting the below error when ever I run my application:

Apparently wrong driver class specified for URL: class: com.ibm.as400.access.AS400JDBCDriver, url: jdbc:as400://DBSYTEM;driver=toolbox;trace=false;errors=full;prefetch=true;naming=system;libraries=*LIBL

Has anyone ever faced similar problem before?

Thanks,

Veera.

A: 

From the connection URL in your question, I think you're using DB2 on AS/400.

Have you verified the existence of the correct classpath of IBM DB2 for AS/400 JDBC driver? The JDBC driver of IBM DB2 for AS/400 is not provided by JBoss Application Server, it's provided only from IBM.

eriawan
I've placed the the DB2 JDBC driver db2java.jar as well as jt400.jar files inside the WEB-INF/lib folder. but still I'm getting the errors. :(
No, this is sometimes not enough. you have to be sure that your Java CLASSPATH has included your Java classes or jar files of your IBM DB2 for AS/400 JDBC driver, not just the WEB-INF folder/directory.
eriawan
+1  A: 

I had exactly the same problem.

Setting connection-url as the following resolved the problem. jdbc:as400://[systemname]/[schema];extended dynamic=true;package=jbpkg;package cache=true;package library=jboss;errors=full

Evgeny Tshiorny