Java JDBC-ODBC cannot load driver for Excel -
import java.sql.connection; import java.sql.drivermanager; public class connectionexample { public static void main(string args[]) { try { class.forname("sun.jdbc.odbc.jdbcodbcdriver"); } catch (exception e) { system.out.println("jdbc-odbc driver failed load."); return; } try { connection con = drivermanager.getconnection("jdbc:odbc:abcdefg", "", ""); con.close(); } catch (exception e) { system.out.println(e); } } }
this code prints
"jdbc-odbc driver failed load."
i can't understand problem is.. follow these steps:
go c:\windows\syswow64\odbcad32.exe
system dsn tab - add
-> microsoft excel driver (*xls, *xlsx, *xlsm, *xlsb)
give data source name abcdefg
select workbook
-> go myfile excel path , add -> ok
and run code... mistake?
the jdbc-odbc bridge obsolete , has been removed java 8. if need manipulate excel document , unable (or unwilling) downgrade environment java 7 might want investigate apache poi.
Comments
Post a Comment