I have a j2ee application deployed on WAS. I use following code to connect to db2 database and it throws "No Suitable Driver found" exception. I have created a shared lib on WAS and have included db2jcc4.jar in the shared lib. Added a reference to it in my application.
DriverManager.getConnection("jdbc:db2://host:port/dbname", "user", "password");
Do I need to do anything else? Any other jar I need to put in the shared lib? or any other way of putting the jar in classpath?
Appreciate your help
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
2 replies Latest Post - 2011-05-28T14:16:43Z by SumaGS
Pinned topic No suitable driver
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-05-28T14:16:43Z at 2011-05-28T14:16:43Z by SumaGS
SystemAdmin 110000D4XK1731 PostsACCEPTED ANSWER
Re: No suitable driver2011-05-28T05:34:09Z in response to SumaGSHI suma...
I am sathya working as filenet developer.
Below is the sample code to connect DB2,
Connection conn = DriverManager.getConnection("jdbc:db2://demo1:50000/OBJST1", "db2admin", "database1");
if (conn == null)
System.out.println(" Connection success ");
DriverManager.getConnection("jdbc:db2://<host name>:<DB2 port number>/<data base name>", "<user name>", "<password>");
jar files in classpath:
i thought that , above are the enough precautions to get the connection from DB2, i hope that it is very help full to you.
SumaGS 120000QT942 PostsACCEPTED ANSWER
Re: No suitable driver2011-05-28T14:16:43Z in response to SystemAdminHi Sathya,
Thanks for the response.
I always tried with the following code.
Connection conn = DriverManager.getConnection("url", "db2admin", "database1");
I did not load the driver explicitly. It worked fine for weblogic + db2, weblogic + oracle, WAS + oracle.
I see "No suitable driver" error only for WAS + DB2 combination.
But when I load the Driver explicitly, I was able to get the connection. Wondering why explicit loading is required only for WAS + DB2 combination.