• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting serial number using Informix jDriver

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Please guide me if i am wrong,
I know that getSerialNumber() method in weblogic.jdbc.informix4.Statement class would retrieve the serial key after insertion.
I am type casting Java sql statement to informix statement to get the serial number, please look at the code below.
--stmt = (weblogic.jdbc.informix4.Statement)con.createStatement()
This code is working fine when i open a connection directly (by-passing connection pool), please look at the code below.
--Driver myDriver= (Driver) Class.forName("DriverName").newInstance();
--Connection con = myDriver.connect("DriverClass", Properties)

But if i get the connection using DataSource, type casting statement to informix is throwing an exception
java.lang.ClassCastException: weblogic.jdbc.rmi.SerialStatement
--DataSource ds = (DataSource) ctx.lookup ("DataSourceName");
--Connection conn = ds.getConnection();

Opening a connection directly would not allow the connection to participate in the current transaction and so rollbacks are giving weird results.
Can anybody help me in this regard.
Thanks in advance,
-Sridhar Kancharlapalli.
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic