Java.sql.SQLException: No suitable drivers found for jdbc: odbc: Driver = {Microsoft Text Driver (* .txt; * .csv)}; DBQ = D: \ Users \

advertisements

i need help with the ODBC - JDBC Interface for CSV, with 32Bit Java 1.7.0_72

i recieved this code

    private void connectToCSV(String file) {
    try {
        debug.println(path + file +" "+this.file);
        if (this.file == null){
            this.file = file;

            gfdiConnection = DriverManager.getConnection("jdbc:odbc:Driver={"+ driverCSV + "};DBQ=" + path );

        }
        if (this.file != file){

        this.file = file;
        gfdiConnection = DriverManager.getConnection("jdbc:odbc:DRIVER={" + driverCSV + "};DBQ=" + path);
        }
    } catch (SQLException e) {
        debug.println("Error while trying to connect to CSV");
        e.printStackTrace();
    }
}

but I didn't get run it.

java.sql.SQLException: No suitable driver found for jdbc:odbc:Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=D:\Input\

I found a suggestion with

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
gfdiConnection = DriverManager.getConnection("jdbc:odbc:Driver={"+ driverCSV + "};DBQ=" + path );

but this didn't work here.

java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver

I checked also the Driver Name with

 C:\Windows\SysWOW64\odbcad32.exe

so whats the Problem with the Driver ?


System.getProperty("java.version") reported "1.8.0_66" so the application actually was running under Java 8, which has dropped the JDBC-ODBC Bridge.