Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring+iBatis+JBoss datasource connection issue

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,

We are using Spring and iBatis in our application which is deployed on JBoss.

Our datasource is configured on JBoss which we lookup through JNDI.

In one of our funtions, we are required to make a call to a stored procedure which has an Oracle.ARRAY as IN parameter. Now in order to create a StructDescriptor/ArrayDescriptor, we need to pass the connection object to the createDescriptor.

However, when weI get the connection object from the datasource and pass it to the createDescriptor method

java.sql.Connection conn = setter.getPreparedStatement().getConnection();

StructDescriptor structDescriptor = StructDescriptor.createDescriptor("OBJECT_NAME", conn);

We get a
java.sql.SQLException: org.jboss.resource.adapter.jdbc.WrappedConnection

a) If we create a regular direct JDBC connection, it runs fine.
b) If we load the sql-map-config.xml at run time (it has a datasource object defined in it), it runs fine.

We would however like to use the already created datasource for all db purposes.

Any help would be appreciated.

Thanks and Regards,

Yoshita
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would this work?
 
Yoshita Jain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jaikiran,

Thanks for your reponse.

When we include the jboss-common-jdbc-wrapper.jar (which contains org.jboss.resource.adapter.jdbc.WrappedConnection) we can't seem to get the connection right and we get an exception while executing a regular select statement through iBatis.

Yoshita
[ April 11, 2008: Message edited by: Yoshita Jain ]
 
    Bookmark Topic Watch Topic
  • New Topic