XSU Problem
Date: 2000/07/16
Message-ID: <8kt0nh$34ot4$1_at_ID-38933.news.cis.dfn.de>#1/1
Hello,
I tried the XSU-Utility with the Java-Program shown below. I use Sun's JDK 1.2.2, Oracle 8.0.5, Oracle XMLParser V2 and the latest version of Oracle's XML SQL Utility.
Following I include to the CLASSPATH:
/usr/lib/java/lib/classes.zip:
/opt/oracle/product/8.0.5/jdbc/lib/classes111.zip:
/opt/oracle/xmlparser/lib/xmlparserv2.jar:
/opt/oracle/OracleXSU111/lib/xsu111.jar
The program should connect to the database and make a simple select-query to the emp-table and should show a XML-Document.
Compiling is no problem, but running the program with java samp1 I get the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/sql/Datum at oracle.xml.sql.query.OracleXMLQuery.<init>(OracleXMLQuery.java:137) at samp1.main(samp1.java:49)
Any idea what went wrong? Thanks!
Alex
samp1.java
import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*; import oracle.jdbc.*; import oracle.jdbc.driver.*;
public class samp1
{
//========================================// main() - public static void
public static void main(String args[]) throws SQLException {
String tabName = "emp";
String user = "scott/tiger";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc:oracle:oci8:"+user+"_at_sid0");
Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery("select ename from "+tabName );
boolean more = rset.next();
while (more) {
System.out.println("Name : " + rset.getString(1)); more = rset.next();
}
// init the OracleXMLQuery
OracleXMLQuery qry = new OracleXMLQuery(conn,rset);
// get the XML document is the string format String xmlString = qry.getXMLString();
// print out the result
System.out.println(" OUPUT IS:\n"+xmlString);
}
}
Received on Sun Jul 16 2000 - 00:00:00 CEST