aspose file tools*
The moose likes JDBC and the fly likes Oracle XML get data problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Oracle XML get data problem" Watch "Oracle XML get data problem" New topic
Author

Oracle XML get data problem

omar bili
Ranch Hand

Joined: Aug 13, 2004
Posts: 177
Hi, i finally found a code that allow me to
query an XMLType table from oracle, but this
program is exiting for no reason, here is the code:

...
String user = "stage";
String pass = "stage";
dbUrl = "jdbcracle:thin:@192.168.0.28:1521:ORA9i";
try{


Class.forName(driver);
Connection conn = DriverManager.getConnection(dbUrl, user, pass);

OraclePreparedStatement stmt =
(OraclePreparedStatement) conn.prepareStatement(
"select * from xxx ");
//xxx is a xmltype database

ResultSet rset = stmt.executeQuery();
OracleResultSet orset = (OracleResultSet) rset;

// get the XMLType
while (orset.next() ){
XMLType poxml = (XMLType)orset.getObject(1);/* the error is occuring here*/
String poString = poxml.getStringVal();
}

the error is 'i am using JBuilder':

java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException

at oracle.xdb.XMLTypeFactory.create(XMLTypeFactory.java:67)

at oracle.sql.OPAQUE.toClass(OPAQUE.java:558)

at oracle.sql.OPAQUE.toJdbc(OPAQUE.java:469)

at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5719)

at oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:5622)

at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:739)

at oraclefirsttest.MainFrame.jButton2_actionPerformed(MainFrame.java:263)

at oraclefirsttest.MainFrame_jButton2_actionAdapter.actionPerformed(MainFrame.java:342)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)

at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)

at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)

at java.awt.Component.processMouseEvent(Component.java:5100)

at java.awt.Component.processEvent(Component.java:4897)

at java.awt.Container.processEvent(Container.java:1569)

at java.awt.Component.dispatchEventImpl(Component.java:3615)

at java.awt.Container.dispatchEventImpl(Container.java:1627)

at java.awt.Component.dispatchEvent(Component.java:3477)

at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)

at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)

at java.awt.Container.dispatchEventImpl(Container.java:1613)

at java.awt.Window.dispatchEventImpl(Window.java:1606)

at java.awt.Component.dispatchEvent(Component.java:3477)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Thanks for any help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle XML get data problem