This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Oracle's XMLType.createXML() fails... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Oracle Watch "Oracle New topic
Author

Oracle's XMLType.createXML() fails...

Heath Lilley
Ranch Hand

Joined: Jan 09, 2001
Posts: 72
Hello all,
I recently was able to insert/select an xml document from the database using a CLOB. We have a need to do the same thing using the Oracle XMLType object.
We are currently running Oracle 9i (9.2.0.1) on a Solaris Server.
My java environment is WSAD 5.0.1 with Oracle XDK 9.2.0.5.0 running on Win2k.
Now my xml document appears to be well-formed (i even tried hard coding the string "<test>foo</test>"). But when I try to create an instance of the Oracle XMLType to set in my PreparedStatement I get an error. I have tried 2 of this type�s overloaded methods and each causes a different type of error...
XMLType xml = XMLType.createXML(con, doc); always assigns null to xml. I don't get any exception and my connection object is fine because I prepare my statement before this line is hit.
XMLType xml = XMLType.createXML(con, xmlString); throws a ClassCastException. I am not sure why this is happening. But my log4j logger says that the class cast exception is coming from the OracleConnectionProxy.
Does anyone have any thoughts on this?
Any help would be greatly appreciated.
Thanks

EDIT: The method is XMLType.createXML() not XMLType.Crate().
[ December 09, 2003: Message edited by: Heath Lilley ]
Thomas G�nther
Greenhorn

Joined: Oct 10, 2005
Posts: 2
Hello, I get exactly the same results.

I found some hints that the problem arises because the Oracle XDB-Package is not installed (see the second reply in this thread: http://forums.oracle.com/forums/message.jspa?messageID=791302).

I checked and the statement mentioned ("select 1 from all_users where username='XDB'") returns nothing on my Oracle-installation. My Oracle people will help me to install the package and I will post the results here.

After reading the Oracle documentation I had the impression that XDB is always part of Oracle and therefore is always part of an installation.

kind regards.

Thomas G�nther
[ October 10, 2005: Message edited by: Thomas G�nther ]
Thomas G�nther
Greenhorn

Joined: Oct 10, 2005
Posts: 2
I got the xdb-Package installed and sorry, no luck.

If anybody finds a solution to the problem, I am really interested to know what is wrong.

kind regards,

Thomas
J.L Brown
Greenhorn

Joined: Nov 01, 2005
Posts: 1
Has this issue been resolved? I'm getting a similiar 'error' after an Oracle upgrade from 9i to 10g
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle's XMLType.createXML() fails...
 
Similar Threads
axis 1.4 maxOccurs writes out xsi:type - turn off
String to XMLType Conversion
XMLType Column Oracle - InsertIntoDB - Exception
JDBC call to PLSQL block having Oracle type object parameter
need a point in the right direction using XMLTYPE, dbms_xmlgen.convert, dbms_xmlgen.ENTITY_DECODE