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<[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
