xml - Java: Oracle XMLType + JDBC -
how can oracle xmlelement jdbc?
java.sql.statement st = connection.createstatement(); // works oracle.jdbc.oracleresultset rs = st.execute("select xmlelement("name") dual"); rs.getstring(1); // returns null, why? oracle.sql.opaque = (opaque) rs.getobject(1); // works, wtf opaque ?
basically, want read string <name> </name>
or whatever xml formatted output. fail cast output reasonable. weird oracle.sql.opaque works, totally dont know that. tostring()
not overriden!
any ideas? how read oracle's (i using oracle 10.0.2) xmlelement (xmltype) ?
you can't. oracle's jdbc driver not support jdbc xml type properly.
the thing can do, convert xml part of query:
select to_clob(xmlelement("name")) dual
then can retrieve xml using getstring()
alternatively can use xmlelement("name").getclobval()
, again part of query , can accessed string within java class
Comments
Post a Comment