-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: HibernateXMLType vs Jboss4.2.2
PostPosted: Thu Oct 02, 2008 1:02 pm 
Newbie

Joined: Thu Oct 02, 2008 5:32 am
Posts: 2
Hi all,

i'm trying to use the HibernetXMLType ina an application deployed under jboss Application Server 4.2.2 and i have big problem casting the given ResultSet to OracleResultSet.

Following my custom code:

public Object nullSafeGet( ResultSet rs, String [ ] names, Object arg2 )
throws HibernateException, SQLException
{
XMLType xmlType = null;
Document doc = null;
try {
OPAQUE op = null;
System.out.println("############################## rs: "+rs); // here i can see: oracle.jdbc.driver.OracleResultSetImpl
System.out.println("############################## RUNTIME CLASS: "+rs.getClass().getName());// here i can see: org.jboss.resource.adapter.jdbc.WrappedResultSet
ResultSet underlyingRs = null;
get
try {
org.jboss.resource.adapter.jdbc.WrappedResultSet wrappedRs = (org.jboss.resource.adapter.jdbc.WrappedResultSet)rs;
underlyingRs = wrappedRs.getUnderlyingResultSet();
} catch (ClassCastException e) {
// My Exception
e.printStackTrace();
}
OracleResultSet ors = null;
if (underlyingRs instanceof OracleResultSet) {
ors = (OracleResultSet)rs;
} else {
throw new UnsupportedOperationException("ResultSet needs to be of type OracleResultSet");
}
op = ors.getOPAQUE(names[0]);
if(op != null) {
xmlType = XMLType.createXML ( op );
}
doc = xmlType.getDOM();
}finally {
if (null != xmlType) {
xmlType.close();
}
}
return doc;
}

i have tryed to customize this method because using the original one the given ResultSet is not recognized as instance of OracleResultSet and obviously nothing work...

Someone can please help me?

if my explanation was not clear let's tell and i will try to give more details.

Cheers,

Carlo


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.