ojdbc5.jar in JChem 5.2.1

User 870ab5b546

14-05-2009 16:06:02

We installed JChem 5.2.1 yesterday.  When we tried to compile our code, we got a bunch of Oracle errors that we had never seen before, for example, OracleResultSet private, and getBLOB() not found.  When we moved the ojdbc5.jar file out of jchem/lib, then everything compiled fine, although now we get a warning: [path] bad path element "/home/aceorg/aceorg/jchemDEV/lib/ojdbc5.jar": no such file or directory.  


Why do you package ojdbc5.jar with JChem 5.2 and not with JChem 5.1?  Will we later regret moving it out of jchem/lib?  If we decide to keep ojdbc5.jar, is there a document somewhere that tells us what we have to change in our code?  I can't find anything in Google.

ChemAxon aa7c50abf8

14-05-2009 17:18:10

We decided to package the JDBC drivers for the databases JChem supports to make it easier to start using JChem. We found that less Java-savvy users often had problems managing Java CLASSPATH in general and JDBC drivers in particular -- which meant a steep barrier for them to get started with JChem. And even experienced Java users will typically find it easier to have one management step less to perform.


We included the most recent version of the Oracle JDBC driver, because Oracle suggests to use the most recent version when possible and we found it useful to follow this advice ourselves. The particular version we include (11.1.0.7) is compatable with both current and earlier Oracle database versions back to 9.2: http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html .


I don't see any risk in removing the bundled jar file from jchem/lib. The jars in jchem/lib can be basically thought of as the first elements on the CLASSPATH of jchem.jar: these jar files are the first place for the JVM's class loader to look for Oracle classes when trying to resolve calls to them by JChem classes. If the classes cannot be found there, the search continues with the next element on the CLASSPATH. (This behaviour is incoded in the META-INF descriptor of jchem.jar, the
same mechanism which has been used with other jar files in the jchem/jar directory already there in JChem
5.1.) I am not sure what to make of the warning you described -- I don't see it when I remove ojdbc5.jar from jchem/lib and use JChemManager with an  "external" JDBC driver file. (Do you or your application framework use, perhaps, a custom ClassLoader for jchem.jar?)


If your Oracle database version is not older than 9.2, we recommend to use the ojdbc5.jar driver, because you are likely to benefit from the performance improvements and bugfixes included in that recent version. The code migration process is typically straightforward: the current code needs to be adjusted to the new API based on the documentation of the new JDBC driver version (in this case: http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/toc.htm). If you have any specific questions, we will certainly try to answer them.


Regards,


Peter

ChemAxon 9c0afc9aaf

14-05-2009 21:38:11

we get a warning: [path] bad path element "/home/aceorg/aceorg/jchemDEV/lib/ojdbc5.jar": no such file or directory.


 


I am not sure what to make of the warning you described -- I don't see it when I remove ojdbc5.jar from jchem/lib



Just a random idea: Bob, are you using a Sun Java ? What is the output of the "java -version" command ?


Szilard

User 870ab5b546

15-05-2009 01:55:13

[bob@epoch bob]$ java -version
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)


ChemAxon 9c0afc9aaf

15-05-2009 03:31:43










bobgr wrote:

[bob@epoch bob]$ java -version
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)




This looks OK - provided the process was also running as user "bob" and not "aceorg" which threw this error:


path] bad path element "/home/aceorg/aceorg/jchemDEV/lib/ojdbc5.jar"


Szilard

User 870ab5b546

15-05-2009 12:39:25

The process is running as root, under which java -version gives the same result.

ChemAxon aa7c50abf8

15-05-2009 13:45:50

A brief googling made me realize that this warning message is generated during the compilation of Java classes instead of (as I had mistakenly thought) during their execution. It appears that this message is normal under such circumstances and I didn't find anything which would indicate that it is harmful in anyway.


(If you want to stick with your JDBC driver and find these messages such a nuisance, you could ultimately copy your driver file to jchem/lib/ and rename it to ojdbc5.jar.)


Peter

User 870ab5b546

28-07-2009 15:46:50

Just upgraded to JChem 5.2.3.  I removed ojdbc.jar from jchem/lib.  Now, when I compile, I get this warning as well:


warning: [path] bad path element "/home/aceorg/aceorg/jchemDEV/lib/db2jcc4.jar": no such file or directory


There is a jchem/lib/db2jcc.jar, but no db2jcc4.jar.  Is this something I need to worry about?

ChemAxon 9c0afc9aaf

28-07-2009 18:28:48

Hi Bob,


 


You should not worry about this.


It seems we have accidentally listed two DB2 drivers in the manifest, but (correctly) only one is present.


This does not affect DB2 users either.


We will remove the superfluous reference.


 


Best regards,


 


Szilard


 

User 870ab5b546

21-11-2009 23:12:29

We have migrated to Oracle 10g and Java 1.6, and we find that writing CLOBs now causes our application to hang.  We are beginning to suspect a bug in the JDBC.  Can we replace the ojdbc5.jar that comes packaged in JChem 5.2.6 with ojdbc6.jar?  If so, will we need to rename ojdbc6.jar to ojdbc5.jar?

ChemAxon 9c0afc9aaf

24-11-2009 00:19:39

Hi,


We have migrated to Oracle 10g and Java 1.6, and we find that writing CLOBs now causes our application to hang

Is it your code that fails with the CLOB write ?


(If ChemAxon code could you be more specific about the versions ? )


Can we replace the ojdbc5.jar that comes packaged in JChem 5.2.6 with ojdbc6.jar?  

Yes , you can use a different JDBC driver than the one included with the product.


To do this:


- you have to remove the supplied JDBC driver (ojdbc5.jar in your case)


- include the other JDBC driver into the classpath of the JVM (if used in your application) or into the CLASSPATH system environment variable (in case of applications)


If so, will we need to rename ojdbc6.jar to ojdbc5.jar?

You could also do this in theory, but I do not recommend it, as this can lead to confusion.


 


Best regards,


 


Szilard

User 870ab5b546

24-11-2009 00:58:05

Hi,


It was our code that failed, although it worked fine in our Oracle 9i application.


We sort of figured out what was going on.  JChem requires an ojdbc.jar to compile, but the vesion you package with JChem was not the version that our Tomcat was using in runtime.  That version, which came packaged with Oracle 10g, was buggy.  We replaced it with a different version, and we can now write our CLOBs with Oracle 10g methods.  The Oracle 9i method for writing CLOBs doesn't seem to work anymore; we don't know why not.  But anyway, things are working now.


-- Bob