Link to home
Start Free TrialLog in
Avatar of spingarnd
spingarnd

asked on

Cannot Instantiate OracleDriver 8.1.7 in Microsoft JVM

We have an existing application which requires us to stay with MSJ++ for now. Most of the data is stored in SQLServer7. We are attempting to migrate some of the data to Oracle8i. I am having a problem in trying to instantiate the OracleDriver received in classes111.zip with Oracle 8i 8.1.7.  The table we are migrating is used to store XML documents with an average size of approximately 4 K, but possibly larger.

When attempting to use the OracleDriver (either one from classes111.zip), and watching in the J++ debugger, it appears that the attempt to instantiate the OracleDriver causes the virtual machine to hang. classes111.zip is in the CLASSPATH. Is it necessary to use the JDBCODBC bridge, or can the OracleDriver class, and perhaps oci8 be used within MSJ++ ? How?

We anticipate storing the XML data in a CLOB column, and would like to focus the effort on the appropriate driver, since it appears that the approach may vary somewhat depending on the driver. Is there a more appropriate / easier way to store XML in Oracle than using a CLOB? Under SQL7, it was an ntext column.

I'm offering only 75 points, because that is what I have available.  Hope it is sufficient...

Thank you.


The application hangs prior to any attempt to to connect to the server.  In the interest of granularity, I have separated the typical line of sample code which instantiates, and registers the driver, into two lines of code.  They are as follows:

oracle.jdbc.driver.OracleDriver oDriver = new oracle.jdbc.driver.OracleDriver();

DriverManager.registerDriver(oDriver);

I've tried using the oracle.jdbc.OracleDriver (no ".driver") as well, since both are listed in the classes111.zip.  I have not tried classes12.zip.  Not sure whether that would work, since I'm using a 1.1 jdk, but I may try it.

From looking at your website http://users.aber.ac.uk/pms/java/usingoracle.html
I see that you use
Class.forName("oracle.jdbc.OracleDriver");
to register the driver.  Unfortunately, even though classes111.zip is in my classpath, this results in a ClassNotFoundException at run time.  I've now commented out the code and am attempting to use the DriverManager.registerDriver() above, but as I said cannot instantiate the OracleDriver class.  I am able to use the JDBCODBC bridge, but have some concerns about reliability and performance, especially with LOBs.

By the way, from reviewing release notes for Oracle 8.1.7 regarding jdbc, it appears that the only way to reliably stream data into an LOB using JDBC is using the >>oci<< driver.  Other web info (from otn.oracle.com and upenn.edu) about which actual driver can be used with the Microsoft JVM seems to indicate that I would have to use the >>thin<< Oracle driver (Javasoft's VM is not an option for us at this time).  So, I am beginning to think that I will have to use a stored proc accessed via the JDBCODBC bridge...

Avatar of googlyralph
googlyralph

can you give the connection strings that you are using to oracle? (also, have you tried using hte classes12.zip (jdk1.2 and above)?)
i have been doing a lot with Oracle <-> java and have had many problems and so have some idea what i am doing now...

(Also, the following URL (to part of my un-linked to my site) http://users.aber.ac.uk/pms/java/usingoracle.html may be of use.

GR.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points NOT refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial