users@glassfish.java.net

Re: Probs with configuration Informix-Database

From: <glassfish_at_javadesktop.org>
Date: Wed, 22 Aug 2007 00:08:49 PDT

looking at the stack trace, this seems to be an issue with Informix DataSource implementation. Informix is not able to handle a Runtime exception

Caused by: 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)

To ensure that it is a bug with informix, try testing it in stand alone mode (no appserver). Same exception must be seen.
eg:
------------------------------------------------------------------------------------------------------------------
 com.informix.jdbcx.IfxDataSource ds = new com.informix.jdbcx.IfxDataSource()
//set all the necessary parameters to connect to database [same set of properties being set in the jdbc connection pool ]

eg:
 ds.setPort(1527);
 ds.setHost("localhost");
 ds.setUser("APP")
 ds.setPassword("APP");
 
Connection con = ds.getConnection();
------------------------------------------------------------------------------------------------------------------
[Message sent by forum member 'jr158900' (jr158900)]

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