Hi guys!
I wrote simple piece of code to connect to databse. It works fine under windows xp with eclipse and 32 bit java,
It is one class only. I copied it to AIX 5.3 64 bit with JDK6 64bit. Compiled it there, created java archive.
When I try to execute it i get:try { String driver = "com.informix.jdbc.IfxDriver"; Class.forName(driver).newInstance(); System.out.println("Obtained Informix driver."); } catch (Exception e) { System.out.println("ERROR: Failed to load Informix driver." + e.getMessage()); logger.error("Failed to load Informix driver. " + e.getLocalizedMessage() ); logger.error( e.getMessage() ); e.printStackTrace(); return; } try { System.out.println("Using url: " + url); con = DriverManager.getConnection(url, user, password); // HERE I GET THAT EXCEPTION System.out.println("Connected"); } catch (Exception e) { System.out .println("SQLException: Faild to connect using given url"); System.out.println("ERROR: " + e.getMessage()); logger.error("Faild to connect using given url: " + e.getLocalizedMessage() ); logger.error("bla: "+ e.getMessage() ); //e.printStackTrace(); }
SQLException: Faild to connect using given url
ERROR: [HTML]java.lang.NoClassDefFoundError incompatible with java.sql.SQLException/B]
java.lang.NullPointerException
As far as i am concered that exception means that some class (java.sql.Connection from java6_64/jre/libs/sql.jar ) is hided by other class.
MY questions: 1. Is that true what i have written about meaning of that exception
2. If answer on previous question is true How to figure out which jar is it an where it is?