Re: Informix JDBC:sqli connection problem.
Posted in 1999
Muchan For SE, you need to specify the path to the database.dbs file in your JDBC URL. Assume your database is contained in /data/database.dbs, then your URL would look like this. jdbc:informix-sqli://machine:port/ /data/database:INFORMIXSERVER=... Note the space between machine:port/ and the path name. I had this problem too, till someone on this list told me about this. HTH Sujit muchan <muchan@promikra.si> on 10/08/99 05:04:04 AM Please respond to muchan <muchan@promikra.si> To: informix-list@iiug.org cc: (bcc: Sujit Pal) Subject: Re: Informix JDBC:sqli connection problem. I could solve the problem of loading JDBC driver, but connection to the database (on SE server on UNIX machine) never succeed... I always get Error message: ERROR: failed to connect! Exception in thread "main" java.lang.NullPointerException at DBConnection.main(Compiled Code) The code causing exception is: try { conn = DriverManager.getConnection(newUrl); } catch (SQLException e) { System.out.println("ERROR: failed to connect!"); } Can I trace down into DriverManager.getConnection() where the exception occurs? Does Informix gives source code for JDBC driver? Debugging tips appreciated. muchan > > > > 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