No Suitable Driver Error Db2
Contents |
Driver". no suitable driver DB2 JCC JDBC java connect connection URL class name Technote (troubleshooting) Problem(Abstract) My java application is failing with no suitable driver found for jdbc db2 eclipse the exception, "No Suitable Driver". Symptom java.sql.SQLException: No suitable driver Cause This com.ibm.db2.jdbc.app.db2driver jar occurs when either the incorrect driver class name or more typically the JDBC database URL passed is not no suitable driver db2 properly constructed or incorrect permission to access the driver jar files. When a Connection request is issued, the Driver Manager asks each loaded driver if it understands the URL sent. If
Db2 Driver Class
no driver responds that it understands the URL, then the "No Suitable Driver" message is returned. Resolving the problem Verify following steps: 1) Ensure your application is configured properly with the appropriate driver files included in the CLASSPATH environment setting. db2java.zip for the Legacy Type 2 driver db2jcc.jar for the Universal and Data Server driver for JDBC Check that the proper implementation db2jcc4.jar download class name is used. COM.ibm.db2.jdbc.app.DB2Driver for the legacy Type 2 driver from db2java.zip com.ibm.db2.jcc.DB2Driver for the Universal JCC driver from db2jcc.jar And check that the URL syntax is correct for the connection jdbc:db2:
here for a quick overview of the site Help Center Detailed answers to any questions db2jcc_license_cu.jar download you might have Meta Discuss the workings and policies of
Java.sql.sqlexception: No Suitable Driver Found For Jdbc:
this site About Us Learn more about Stack Overflow the company Business Learn more about hiring
Db2 Jdbc Connection String
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a https://www-304.ibm.com/support/docview.wss?uid=swg21432559 community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up No suitable driver found error for odbc, db2 up vote 0 down vote favorite I'm trying to connect to a remote database using the following java code, but I get an error saying http://stackoverflow.com/questions/10509659/no-suitable-driver-found-error-for-odbc-db2 no suitable driver found. DriverManager.getConnection("odbc:db2://url:port/dbname"); Class.forName("com.ibm.db2.jcc.DB2Driver"); What could I be doing wrong? java sql odbc db2 driver share|improve this question asked May 9 '12 at 4:04 user1016313 4161720 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote Two comments: 1. You have to load the driver first, before trying to use it 2. If I am not mistaken, the driver you are loading is a JDBC driver for DB2 UDB, not ODBC. The connection URL for it is "jdbc:db2//host:port/database" So your code should look something like this: Class.forName("com.ibm.db2.jcc.DB2Driver"); DriverManager.getConnection("jdbc:db2://host_or_ip_address:port/dbname"); share|improve this answer answered May 9 '12 at 4:18 mazaneicha 2,1661021 How exactly do I load the driver? –user1016313 May 9 '12 at 5:06 Loading the driver=loading driver class, i.e. Class.forName("com.ibm.db2.jcc.DB2Driver"); –mazaneicha May 9 '12 at 13:47 add a comment| up vote 1 down vote accepted I found the solution...I didn't add the JAR files for the driver. s
Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers https://coderanch.com/t/307369/JDBC/databases/suitable-Driver-DB Other all forums Forum: JDBC and Relational Databases No suitable Driver in DB2 loganathan kumar Greenhorn Posts: 6 posted 8 years ago Hi, I am working in UNIX.I tried to connect to DB2(client) which is in windows. when i tried to connect to DB2 from UNIX, it no suitable shows No suitable driver. If i connect from windows,it works fine. Here is my code import java.sql.*; public class JdbcTest1 { public static void main (String[] args) { try { Class.forName("COM.ibm.db2.jdbc.app.DB2Driver"); String url = "jdbc:db2:dbname"; Connection conn = DriverManager.getConnection(url,username,password); System.out.println("connection success"); } catch (Exception e) { e.printStackTrace(); no suitable driver System.err.println("Got an exception! "); System.err.println(e.getMessage()); } } } Here is the error that i have got, java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:579) at java.sql.DriverManager.getConnection(DriverManager.java:189) at JdbcTest1.main(JdbcTest1.java:18) db2java.zip,db2jcc.jar are in my classpath. kindly give me a solution. Thanks in advance [ September 22, 2008: Message edited by: loganathan ] T.A. Nguyen Ranch Hand Posts: 36 I like... posted 8 years ago No Suitable Driver, usually mean, that you don't have the correct url. The correct TCP/IP url should be like: "jdbc:db2://host:port/database" for remote connection. And you should use the com.ibm.db.jdbc.net.DB2Driver with it. Your com.ibm.db.jdbc.app.DB2Driver rely on the local connection and thus, the same code will not work on a remote machine, even with other Windows computer. As of version 8, IBM moved to a unified driver you should use: com.ibm.db2.jcc.DB2Driver instead. Please check with IBM website for detail. T.A. Nguyen http://ta.cnci.or