Informix JDBC:sqli connection problem.
Posted in 1999
I have experiences writing Informix Esql/C programs. This time I'm thinking to immigrate to JDBC, and downloaded trial version of Informix JDBC driver 2.00. After installation, I had a difficulty connecting to the database. The most simple program to test connection was demo/basic/DBConnection.java After managing to find to write correct argument, like java DBConnection 'jdbc:informix-sqli://classic:1525:informixserver=classicnet; user=muchan;passwd=pwd' I get: ERROR: failed to load Informix JDBC driver. ERROR: failed to connect! Exception in thread "main" java.lang.NullPointerException at DBConnection.main(Compiled Code) The code causing the error message is: try { Class.forName("com.informix.jdbc.IfxDriver"); } catch (Exception e) { System.out.println("ERROR: failed to load Informix JDBC driver."); } I checked ClassPath, and there is "ifxjdbc.jar", which contains the class "com.informix.jdbc.IfxDriver". So I suppose the class should be found and loaded. Do I missing something? Thanks in advance. muchan