commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerardo Velez <jgerardo.ve...@gmail.com>
Subject DBCP and informix issues!
Date Tue, 18 Aug 2009 18:57:55 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message