commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akacem Mohammed <Mohammed.Aka...@arbeitsagentur.de>
Subject Classcastexception from Statement to ifmxSatetement
Date Wed, 10 Nov 2004 11:57:49 GMT
Hello,

I tried to use de dbcp1.2 und  I follwowed the examples in dbcp commons.
I am using informix database.


I succeesed to get the connection and to execute a query.

but I failed to cast as follow:

	BasicDataSource ds = new BasicDataSource();
    	ds.setDriverClassName("com.informix.jdbc.IfxDriver");
    	ds.setUsername("unknown");
    	ds.setPassword("unknown");
    	ds.setUrl("my db url");
	conn = ds.getConnection();

	stmt = conn.createStatement(); 
             stmt.executeUpdate(sqlstring);

            // get Serial-Wert 
             IfmxStatement informixStatement= (IfmxStatement)stmt; // THE CASTING FAILED HIER
!!
           
             serialvalue = informixStatement.getSerial();


Althougt I earlier used the com.bimechanic.sql package for pooling and the same code above
did work.

do I have to get a new driver from informix or is this a compatibility probleme.


thanks for any help

Mohammed

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


Mime
View raw message