-
1. Re: Oracle XMLType argh !
davidjencks Aug 14, 2002 11:58 AM (in response to rbnb)You don't give many details... but I'd guess you need the Oracle connection class itself to use the xml types?
You can get the Oracle connection by calling con.getUnderlyingConnection(). Be careful though, closing it for instance will have disasterous results on the pooling. -
2. Re: Oracle XMLType argh !
rbnb Aug 15, 2002 3:00 PM (in response to rbnb)Hi David:
Thank you for your help. I have located the getUndelyingConnection method in the ConnectionInPool class, forgive me here.... but how do I get access to the "ConnecitonInPool" class. Sorry about being vague before, I should have told you it was a class cast exception, you were on the ball though with your assumption. I just didn’t want my first post to be a mammoth one with errors an code. Here is the snippet of code that currently blows with the pool,
//connection passed in and used here:
XMLType xmltype = new XMLType.createXML(conn, xmlDoc);
...
pst.setObject(1, xmlType);
//where xmlDoc is my document//
dies because conneciton is in fact a pooled connection
what I hope for:
OracleConnection oconn = (OracleConnection)**get underlying connection**
XMLType xmltype = new XMLType.createXML(oconn, xmlDoc)
...
pst.setObject(1, xmlType);
so I guess my question is how to get the underlying connection....
your help is much appreciated.
Rob -
3. Re: Oracle XMLType argh !
davidjencks Aug 16, 2002 1:13 AM (in response to rbnb)Doesn't
Connection c = ds.getConnection();
OracleCon oc = (OracleCon)((ConnectionInPool)c).getUnderlyingConnection();
work? -
4. Re: Oracle XMLType argh !
rbnb Aug 19, 2002 11:45 AM (in response to rbnb)Got it... ...(I was screwing up my casting) this is what works...
OracleConnection c = (OracleConnection)((ConnectionInPool)conn).getUnderlyingConnection();
XMLType xt = XMLType.createXML(c, content);
Thank you again.
Rob