JBoss Community

Oracle User Type Mappings

created by Bob Frapples in Datasource Configuration - View the full discussion

I have inherited an application system where all of the business logic takes place in the database.  All of the application calls to the database interface with Functions and Stored Procedures and use Oracle User Data Types as both IN and OUT parameters.  I'm working on converting the front end to use Spring w/ Hibernate and I am extending the org.springframework.jdbc.object.StoredProcedure class to interact with the database.

 

If I define the datasource in the Spring configuration file I am able to call getConnection().setTypeMap(Map<String, Class<?>> on the datasource and everything works fine.

 

However I would like to configure the datasource in JBoss and use a JNDI lookup to get a connection from the pool.  When I do this, the .setTypeMap(Map<String, Class<?>> method no longer seems to work.  I keep getting the exception:

 

java.lang.ClassCastException: oracle.sql.STRUCT cannot be cast to ............

 

I tried editing the standardjbosscmp-jdbc.xml file and adding the mappings there but that did not work.

 

So how can I set the Type Map for the JBoss DataSource?

 

JBoss 5.1

Spring 3.0

Hibernate 3.3

JDK 6

 

Thanks

 

 

Reply to this message by going to Community

Start a new discussion in Datasource Configuration at Community