dll - How to integrate part of Java JDK7 as a standalone library in JDK 8 (JDBC-ODBC Bridge) -


i using jdbc-odbc bridge connect quickbooks database. (intuit has offered sparse support, , not have own direct java driver knowledge). great in jre/jdk 7. in jre/jdk 8 feature removed. that's fine. attempting use solution mentioned "frhack" in (removal of jdbc odbc bridge in java 8) post. however, frhack suggesting move bridge directly java 7 java 8, process have each time if wish update jdk.

what want instead, make jdbc.jar file, dll file included, can use standalone library. created jar instructed, placed dll in root of archive.

this seems work...... partly. did not need change of code, , class loads! however, when try connect data source, new library throws npe. since compiled code (class files), can not see exact problem, presume 1 possibility doesn't know location of dll file has changed. following section of code, alongside output of stack trace.


output of stack trace:

debug - exception caught! java.lang.nullpointerexception     @ sun.jdbc.odbc.jdbcodbcdriver.initialize(jdbcodbcdriver.java:453)     @ sun.jdbc.odbc.jdbcodbcdriver.connect(jdbcodbcdriver.java:153)     @ java.sql.drivermanager.getconnection(unknown source)     @ java.sql.drivermanager.getconnection(unknown source)     @ dashboard.modules.uploader.data.databasemanager.connect(databasemanager.java:83)     @ dashboard.modules.uploader.data.databasemanager.outputdata(databasemanager.java:57)     @ dashboard.modules.uploader.uploader.exportdata(uploader.java:182)     @ dashboard.modules.uploader.uploader.run(uploader.java:112) 

code snippet of databasemanager.java:

25    private final string url = "jdbc:odbc:quickbooks"; ... 28    private final string driver = "sun.jdbc.odbc.jdbcodbcdriver"; ... 77    private boolean connect() 78    { 79        boolean result = true; 80        try 81        { 82            class.forname(driver); 83            con = drivermanager.getconnection(url); 84        } 85        catch (classnotfoundexception | sqlexception e) 86        { 87            result = false; 88            e.printstacktrace(); 89            system.out.println(e.getmessage()); 90        } 91        catch (exception x) 92        { 93            system.out.println("debug - exception caught!"); 94            x.printstacktrace(); 95        } 96         97        return result; 98    } 

is assumption correct? there way structure jar file include dll file usable, or place within project can place this? prefer embed jar itself, because of ease of use once set up.

thanks in advance , advice on this!


Comments