Issues with code that appears to store driver information in memory
Michael Parsons <[email protected]>
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <62097669deac47d983d16ae4a05710f8@CO2PR07MB523.namprd07.prod.outlook.com> |
Hi, I am new to IKVM.
I am attempting to convert java code that uses a neon jdbc driver to connect to a db2 database.
The ikvm tool does a marvelous job of creating dlls that I can add to my project.
The potential issue appears related to the following java code:
Class.forName(IConnectionConstants.ClassName ).newInstance();
The class name constant value is the name of the neon driver : "com.neon.jdbc.Driver". the
The UrlPrefix is: "jdbc:neon:db2test". Datasource is blank.
The full code is
java
//create connection using connection properties
Class.forName( IConnectionConstants.ClassName ).newInstance();
String url = IConnectionConstants.URLPrefixBatch + IConnectionConstants.DataSource;
connect = DriverManager.getConnection( url, IConnectionConstants.UserName, IConnectionConstants.PassWord );
setCurrentSQLID(connect);
return connect;
As seen above, the call to getConnection does not use the driver name.
In initial attempts, I received an error that db2test could not be found. This is an ODBC dsn, and does exist. I can successfully connect to the database from my C# project.
I tried registering the driver separately
com.neon.jdbc.Driver myDriver = new com.neon.jdbc.Driver();
DriverManager.registerDriver( myDriver );
String url = URLPrefixBatch + DataSource;
connect = java.sql.DriverManager.getConnection( url, UserName, PassWord );
I then get:
java.lang.UnsatisfiedLinkError
which references:
com/neon/jdbc/ProxyLocal.initenv(IIII)S.
I can see the ProxyLocal class exists in the converted neon dll.
I tried direct calls like:
com.neon.jdbc.ProxyLocal p2 = ProxyLocal.getInstance();
but get the same error.
It seems like it instantiates the driver and puts in memory(?), and then later code (like the ProxyLocal.initenv) grabs it from memory or through some other mechanism.
If the latter is true, I am not sure what the equivalent might be in C#.
Does anyone have suggestions?
Michael Parsons
Solution Architect
[worknet icon 19x20]<http://www.illinoisworknet.com/vos_portal/?partner=> [fbicon] <https://www.facebook.com/illinois.worknet> [twittericon] <https://twitter.com/ILworknet> [linkedinicon] <http://www.linkedin.com/company/illinois-worknet> [jobClub icon small 2] <http://www.linkedin.com/groups/Illinois-Virtual-Job-Club-Network-4794123> [youtubeicon] <http://www.youtube.com/illinoisworknet> [jobPrep_25] <http://www.illinoisworknet.com/vos_portal/residents/en/Home/News/DisplayNews.htm?id=421d213f-40cd-4631-b459-545efe003274>
Download the Illinois workNet jobPrep Mobile App in Google Play<https://play.google.com/store/apps/details?id=com.solstice.dceo.worknet&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5zb2xzdGljZS5kY2VvLndvcmtuZXQiXQ..> or iTunes<https://itunes.apple.com/us/app/job-prep/id586985926?mt=8>.
Believe nothing, no matter where you read it or who has said it, even if I have said it, unless it agrees with your own reason and common sense. (Siddhartha Gautama)
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers
image001.gif
(image/gif, 13.3 KB) - not displayed
image002.png
(image/png, 1 KB) - not displayed
image003.png
(image/png, 1.3 KB) - not displayed
image004.jpg
(image/jpeg, 831 B) - not displayed
image005.gif
(image/gif, 14.1 KB) - not displayed
image006.jpg
(image/jpeg, 959 B) - not displayed
image007.png
(image/png, 1.6 KB) - not displayed