users@glassfish.java.net

Re: Probs with configuration Informix-Database

From: <glassfish_at_javadesktop.org>
Date: Wed, 22 Aug 2007 01:36:20 PDT

very good hint :)
Exception in thread "main" java.lang.ClassCastException: java.lang.StringIndexOutOfBoundsException cannot be cast to java.sql.SQLException
        at com.informix.jdbcx.IfxDataSource.getSqliConnection(IfxDataSource.java:194)
        at com.informix.jdbcx.IfxDataSource.getConnection(IfxDataSource.java:106)
        at de.barmenia.muv.jpa.Client.<init>(Client.java:58)
        at de.barmenia.muv.jpa.Client.main(Client.java:69)
Java Result: 1

The reason:

It is neccessary to set the IFXHost:

            com.informix.jdbcx.IfxDataSource ds = new com.informix.jdbcx.IfxDataSource();
[b] ds.setIfxIFXHOST("db02");[/b]
ds.setServerName("bingo_atsoc");
            ds.setPortNumber(1598);
            ds.setUser("x_bhm");
            ds.setPassword("pass");
            Connection con = ds.getConnection();

Without the bold line, the stacktrace is like the glassfish-stacktrace. If one set the IfxIFXHost correctly, all is fine.

I use the 3.00-driver and hope, that there is a new one :)

Thanks a lot for help
[Message sent by forum member 'pecabo' (pecabo)]

http://forums.java.net/jive/thread.jspa?messageID=231957