Error Connecting To Database Using Class Sun.jdbc.odbc.jdbcodbcdriver
Matt, I have a problem using MSSQL native connection in spoon, Error occured while trying to connect to the database Error connecting to database: (using class net.sourceforge.jtds.jdbc.Driver) Network error IOException: Connection refused: connect be.ibridge.kettle.core.exception.KettleDatabaseException: Error occured while trying to connect to the database Error connecting to database: (using class net.sourceforge.jtds.jdbc.Driver) Network error IOException: Connection refused: connect i had the same problem with another application and i found a tip in JTDS site, it was add the instance to the connection URL, it means : jdbc:jtds:sqlserver://127.0.0.1/
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss http://forums.pentaho.com/archive/index.php/t-48376.html Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver Exception occuring. Why? up vote 20 down vote favorite 3 I have created an MS Access database and http://stackoverflow.com/questions/22984438/java-lang-classnotfoundexception-sun-jdbc-odbc-jdbcodbcdriver-exception-occurin assigned a DNS to it. I want to access it through my Java application. This is what i am doing: public class AccessDbConnection { public static void main(String[] args) { System.out.println("**ACCESS DB CONNECTION**"); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // for MS Access ... MS access driver loading String conURL = "jdbc:odbc:sampleDNS"; Connection con = DriverManager.getConnection(conURL); Statement statement = con.createStatement(); String qry = "SELECT * FROM Table1"; ResultSet rs = statement.executeQuery(qry); while(rs.next()) { String id = rs.getString("ID") ; String fname = rs.getString("First_Name"); String lname = rs.getString("Last_Name"); System.out.println(id + fname + lname); } } catch (ClassNotFoundException ex) { System.out.println("Classforname Exception!!"); Logger.getLogger(AccessDbConnection.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { System.out.println("DriverManager Exception!!"); Logger.getLogger(AccessDbConnection.class.getName()).log(Level.SEVERE, null, ex); } } } I am getting the exception at the first line of try block. That is class.forname("..");. Can anyone help me to get me out of this, and why am I having this Exception? ja
in Java 8 java.lang.classnotfoundexception sun.jdbc.odbc.jdbcodbcdriver exception comes in Java 8 because it has removed the JDBC ODBC bridge driver class "sun.jdbc.odbc.jdbcodbcdriver" from JDK and JRE. This class is required to connect any database using Object database connectivity driver e.g. http://javarevisited.blogspot.com/2015/07/how-to-solve-javalangclassnotfoundexception-sun.jdbc.odbc.jdbcodbcdriver.html Microsoft Access, but unfortunately you cannot use it from JDK 8 onward. In order to solve this error, just useJackcess library or a commercial driver like HXTT. Normally, in pre Java 8 world, java.lang.classnotfoundexception sun.jdbc.odbc.jdbcodbcdriver error http://www.ariscommunity.com/users/mstromberger/2015-10-15-sunjdbcodbcjdbcodbcdriver-not-found comes when youtry to connect to Microsoft Access database from Java using JDBC and JDBC ODBC bridge driver is not available in classpath. If you remember, In order to open SQL connection to database, first error connecting step is to load and register the driver. In order to load driver, we use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); and this method throws java.lang.classnotfoundexception sun.jdbc.odbc.jdbcodbcdriver, if ClassLoader is not able to find the requested class (sun.jdbc.odbc.JdbcOdbcDriver)in CLASSPATH. In order to connect to MS Access, we need type 1 JDBC driver, also known as JDBC ODBC bridge driver and the class in question, JdbcOdbcDriver is driver implementation to connect to Open database connectivity driver installed in error connecting to machine. Just remember that sun.jdbc.odbc.JdbcOdbcDriver is a standard class from JDK API and it doesn't come with any external JAR like other vendor database's JDBC drivers e.g. JDBC driver to connect Oracle database comes on ojdbc6.jar and MySQL driver comes in mysql-connector-java-5.1.23-bin.jar. JdbcOdbcDriver class is present in rt.jar, which is always included in Classpath, as this JAR file is part of the JRE. Many newbie in Java programming prefer to connect to MS Access database from Java then bigger database like Oracle, SQL Server or MySQL. Even I have done the same when I first started learning JDBC, main reason for that was MS ACCESS comes as part of Microsoft Office and was available in my machine. I didn't have to go with pain involved on installing Oracle, SQL Server or MySQL database, sometime even you don't even have administrator access in your machine to do that. BTW, there are several disadvantage of using JDBC ODBC Bridge driver, first it require ODBC driver to be installed in your machine, second it makes your code platform dependent. Usingpure Java type 4 JDBC driver is best way to connect commercial database from Java programs. Almost all major database vendor provides type 4 JDBC driver now days, so its just matter of finding right version and d
in case ARIS Express Create stunning processes Home > Forums > ARIS Support > MashZone > sun.jdbc.odbc.JdbcOdbcDriver not found sun.jdbc.odbc.JdbcOdbcDriver not found by Martin Stromberger in MashZone posted on 2015-10-15 Hi, i tried to install a database connection to a MS Access DB via the JDBC-ODBC Bridge. The ODBC System DSN is called "FHDemo" (64-Bit Driver). Now the error message occurs - ".... sun.jdbc.odbc.JdbcOdbcDriver not found.."- any solution Thx Martin 7466 Views0 Likes4 Comments Sorry there are no tagsThere are no attachments Comments Gerhard Müller posted on 2015-10-16 Hello Martin, you are probably running Mashzone under Java 8, which does not contain the JBDC-ODBC bridge anymore. Thus, newer releases of Mashzone do not provide the driver class in the select box shown above. If you want to get data from a MS Access database you will have to use a 3rd party JDBC driver which can be found on the web. If you have found an adequate driver lib, please put it in the "jdbcdrivers" folder of your installation and restart Mashzone. Hope this helps. Best regards, Gerhard Log in or register to post comments BAL KRISHAN posted on 2015-12-22 Hi Gerhard, I am also facing the similar issue. I am trying to connect the Oracle DB 11g. When I am trying to connect, I am getting the error : Unable to find JDBC driver class "sun.jdbc.odbc.JdbcOdbcDriver" connecting to database I placed the rt.jar under :