commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <ja...@carmanconsulting.com>
Subject Re: DBCP and informix issues!
Date Tue, 18 Aug 2009 19:17:44 GMT
You need to allow access to the underlying connection:

http://commons.apache.org/dbcp/configuration.html

Search for "underlying", there's a code example.

On Tue, Aug 18, 2009 at 2:57 PM, Gerardo Velez<jgerardo.velez@gmail.com> wrote:
> Hi!
>
> I've been working around a web application using java + informix + tomcat
>
> So my problem is at time I trieds to insert a row in some specific table and
> after that retrieve the serial number (autoincrement id) from informix.
>
> This is the snipped of code I have and the error generated:
>
>
> [CODE]
> java.sql.Connection = conn = dataSource.getConnection();
> java.sql.Statement stmt = conn.createStatement();
>
> stmt.executeUpdate(insertSQL);
>
> int serial = ((IfmxStatement)stmt).getSerial();
>
> [Error]
> java.lang.ClassCastException:
> org.apache.tomcat.dbcp.dbcp.DelegatingStatement cannot be cast to
> com.informix.jdbc.IfmxStatement
>
>
> My Connection pool, looks as follow:
>
> <Resource name="jdbc/SIPDB" auth="Container" type="javax.sql.DataSource"
>               maxActive="100" maxIdle="30" maxWait="10000"
>               username="mgrnsip" password="prx217n"
> driverClassName="com.informix.jdbc.IfxDriver"
>
> url="jdbc:informix-sqli://myhostname:myport/mydatabase:INFORMIXSERVER=dev"/>
>
>
> Thanks in advance!
>
> -- Gerardo Velez
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message