Sending xml data retreived from oracle db from a java application into an other oracle db

Hí,

I would like to retreive oracle data in an xml format and want to send that data to an other database. I have used XDK and was able to retreive data, but when im trying to send it, its giving me a runtime exception that the below statement is depracated << OracleXMLSave save = new OracleXMLSave(conn, tableName);>>.

So I want to know what is the other way available to send data?

So what does depracated mean in java, if it means taken away then what is the other new one that has been added or replaced?

All contributions will be appreciatted.

Thanks

My code looks like this......
-----------------------------------------------------------------------------------------------------
import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.dml.*;
import oracle.xml.sql.*;
import java.net.*;

public class testxml
{
    public static void main(String args[]) throws SQLException
    {
       
        Connection conn;
       
         
       
                         try
                                {
                              DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
                     
                        conn = DriverManager.getConnection ("");
                       
                             OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");
                              
                              //qry.setMaxRows(1);
                              
                            
                              String sx = qry.getXMLString();
                              String tableName = "employee";
                              
                              String fileName = (sx);
                              
                              
                              System.out.println(sx);
                              
   runtime exception >>>>> OracleXMLSave save = new OracleXMLSave(conn, tableName);
                            
                      >>>>  URL url = save.createURL(fileName);
                              int rowCount = save.insertXML(url);
                              System.out.println("successfull");
                              conn.close();
                            
                                         
                                }
                                
                                       catch (SQLException e)
                                         {
                                          System.out.println(e);
                                                  }
       
    }
}
vihar123Asked:
Who is Participating?
 
zzynxConnect With a Mentor Software engineerCommented:
0
 
zzynxSoftware engineerCommented:
bottom line: it should no longer be used at all, as it might well cease to exist in the future.
0
 
vihar123Author Commented:
>>bottom line: it should no longer be used at all, as it might well cease to exist in the future.

so what are the other possibilities through which, this could be achieved?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
girionisConnect With a Mentor Commented:
What do the docs say? JavaDocs should indicate which methods you should be using instead.
0
 
zzynxSoftware engineerCommented:
Your package documentation should propose what to use instead.
0
 
zzynxSoftware engineerCommented:
I think it complains about this line:

>>>>>        URL url = save.createURL(fileName);

At http://www.oracle.com/technology/tech/xml/xdk/doc/beta/doc/java/javadoc/oracle/xml/sql/dml/OracleXMLSave.html I read:

java.net.URL createURL(java.lang.String fileName)
          Deprecated. since XSU2.0 -- use the static version of this method instead

0
 
zzynxSoftware engineerCommented:
0
 
Giant2Connect With a Mentor Commented:
instead of URL url = save.createURL(fileName);

use URL url=OracleXMLSave.getURL(fileName);
0
 
vihar123Author Commented:
createURL(java.lang.String fileName)
          Deprecated. since XSU2.0 -- use the static version of this method instead

what does using the static version of this method mean, can somebody explain me :-)
0
 
girionisCommented:
It simply means that you can call it without a reference to the instance of the class, something like:

URL url = MyClass.myMethod();

instead of doing:

MyClass myClass = new MyClass();
URL url = myClass.myMethod();
0
 
Giant2Commented:
0
 
zzynxSoftware engineerCommented:
>> what does using the static version of this method mean, can somebody explain me :-)
As Giant said before you asked:

replace
        URL url = save.createURL(fileName);
by
        URL url = OracleXMLSave.getURL(fileName);
0
 
vihar123Author Commented:
its giving me the following exception at this line >>>>OracleXMLSave save = new OracleXMLSave(conn, tableName);

java.lang.NoClassDefFoundError: oracle/jdbc2/Clob
        at testxml.main(testxml.java:39)
Exception in thread "main"

0
 
Giant2Commented:
oracle/jdbc2/Clob is part of the driver. Are you sure this is in your classpath?
0
 
vihar123Author Commented:
im not sure if its in my class path, shld I download this driver? where can i get this?
0
 
zzynxSoftware engineerCommented:
0
 
zzynxSoftware engineerCommented:
0
 
vihar123Author Commented:
well im little bit confused, first i dont know what i shld download, is it classes12 or something else, and second things do i need to change my code
please clarify my doubts
0
 
girionisCommented:
It should be classes12. Open it up and check if it is there.
0
 
zzynxSoftware engineerCommented:
>> do i need to change my code
If you did the change we suggested for tackling your initial deprecated problem, no.
For this java.lang.NoClassDefFoundError you don't need to change anything.
0
 
Giant2Commented:
I see this:
http://sales.esicom.com/sales/oracle/java.816/a81354/oraint3.htm#1057115

What kind of environment are you using?
Oracle version? Oracle driver version? Java version?
0
 
vihar123Author Commented:
ok i have read some docu, so i need classes111.zip - JDBC classes,

JDK Support
Oracle 8i Release 2 supports JDK 1.2 and JDK 1.1. As regards the former, the JDK 1.2 versions of the JDBC drivers are fully compliant with JDBC 2.0. The implementation is by means of the interfaces in the standard java.sql package included in the file classes12.zip. On the Oracle side, these interfaces are implemented as appropriate by classes in the oracle.sql and oracle.jdbc.driver packages. The files java.sql.* and oracle.sql.* need to be imported for _JDK 1.2.
As regards JDK 1.1.x, the file classes111.zip is needed. The implementation of JDBC2.0 functionality is by means of the package oracle.jdbc2 still included in classes111.zip. Features such as objects, object references, arrays, and LOBS can be used by importing this package. The files java.sql.*, oracle.jdbc2.*, and oracle.sql.* need to be imported for JDK 1.1.x.
The package java.sql.* comes with JDK; the packages oracle.sql.*, oracle.jdbc.driver, and oracle.jdbc2 come with Oracle's drivers.
0
 
girionisCommented:
Can you post us your classpath?
0
 
vihar123Author Commented:
>>>What kind of environment are you using?
Oracle version? Oracle driver version? Java version?

I didnt understand your question

>>>Can you post us your classpath?

c:\j2sdk1.4.2_03\jre\lib\ext
0
 
vihar123Author Commented:
when I am going to this link to download, its showing as page not found......is there any other site or public domain where i can download this classes111.zip


http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html

0
 
girionisCommented:
You shouldn't need classes111.zip, classes12.zip should be enough.
0
 
zzynxSoftware engineerCommented:
If you don't want to mess with the class path,
then just place the downloaded jar file in your c:\j2sdk1.4.2_03\jre\lib\ext directory
0
 
vihar123Author Commented:
>>>You shouldn't need classes111.zip, classes12.zip should be enough.

should i set some path or somethings with the classes12

my classes12.jar is in the ext already
0
 
Giant2Commented:
why you do not use:
ojdbc14.jar
instead of
classes12.jar ??
0
 
vihar123Author Commented:
is there any othe site where i can download this classes111.zip?
0
 
vihar123Author Commented:
could anybody answer, its a little bit urgent.

thanks
0
 
zzynxSoftware engineerCommented:
>> is there any othe site where i can download this classes111.zip?
Sorry, can't find one :(

0
 
Giant2Commented:
Sorry for the late, I was out of office.

The site of Oracle is the "standard" for download the JDBC driver
0
 
Giant2Commented:
classes111.zip.
So You are using Oracle 9.2 and java1 environment.
This is the answer to my previous post:
>>>What kind of environment are you using? Oracle version? Oracle driver version? Java version?

And now.
Do you have a particular requirement for using this kind of java environment?
0
 
zzynxSoftware engineerCommented:
>>The site of Oracle is the "standard" for download the JDBC driver
Right, but it gives "page not found" when clicking the classes111.zip file...
0
 
Giant2Commented:
please vihar123, answer to my last question.

zzynx, I allready see it gives "page not found". I only say that it's really difficult to find other site to download this api.
0
 
vihar123Author Commented:
ok i found it and put it in the ext folder, and now its giving me a new exception "java.sql.SQLException: Exceding key size"

i dont have any idea about this error

any contributions
0
 
Giant2Commented:
you are doing a query using keyfield of different size. In particular from bigger to little.
0
 
vihar123Author Commented:
>>>Do you have a particular requirement for using this kind of java environment?

well my requirement is extracting oracle data in xml format and send it into an other database.
0
 
Giant2Commented:
>>>Do you have a particular requirement for using this kind of java environment?
>well my requirement is extracting oracle data in xml format and send it into an other database.
I speak about JAVA environment. (version java 1.1 and not java 1.4 for example).


for the last exception, check the field where you are inserting data. Maybe they are little short.
0
 
vihar123Author Commented:
>>>you are doing a query using keyfield of different size. In particular from bigger to little.

how should i solve this problem? im putting all my code for better idea.....

actually in my code, im retreiving a table in xml format, and then putting it into a file and then sending it to database.

---------------

import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.dml.*;
import oracle.xml.sql.*;
import java.net.*;
import oracle.xml.parser.v2.*;
import java.io.*;
import oracle.xml.sql.dml.OracleXMLSave;



public class testxml
{
    public static void main(String args[]) throws SQLException
    {
       
        Connection conn;
       
         
       
                         try
                                {
                              DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
                     
                        conn = DriverManager.getConnection ("");
                       
                              OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");
                              String sx = qry.getXMLString();
                              System.out.println(sx);
                              
                              //table into whichi, the data would be inserted//
                              String tableName = "employee";
                              String fileName = "emps.xml";
                              
                              sx = "emps.xml";
                              
                              //inserting data from xml into database table//
                              
                              OracleXMLSave save = new OracleXMLSave(conn, tableName);
                              URL url=OracleXMLSave.getURL(fileName);
                                                         
                              System.out.println("success");
                              conn.close();
                              
                                }
                                
                                       catch (SQLException e)
                                         {
                                          System.out.println(e);
                                                  }
       
    }
}
0
 
vihar123Author Commented:
>>>I speak about JAVA environment. (version java 1.1 and not java 1.4 for example).

ok sorry i misunderstood, well im using 1.4

an other question is, should i be having the table first being created in my database? cause in the documentation i read it creates by its own.
0
 
zzynxSoftware engineerCommented:
>> now its giving me a new exception "java.sql.SQLException: Exceding key size"
Complete stack dump please... At what line is it thrown?
0
 
Giant2Commented:
>im retreiving a table in xml format
but not the structure.
If you try to save a NVARCHAR2 size 100 in NVARCHAR2 size 10, I believe there could be an error.

The thing you must be sure is that the data type and size where you are inserting are compatible with what you read.
You must check the structures.
0
 
vihar123Author Commented:
>>>Complete stack dump please... At what line is it thrown?

no line is shown, a runtime exception

>>>The thing you must be sure is that the data type and size where you are inserting are compatible with what you read.
You must check the structures.

so that means i shld have the table created in db where i want to send data


0
 
Giant2Commented:
>im using 1.4

For this version is present this jar on the OracleSite (when it'll go up)
ojdbc14.jar


>should i be having the table first being created in my database? cause in the documentation i read it creates by its own.

I believe it execute a dump only for the query of data and not about the structure.
0
 
Giant2Commented:
See here:
http://www.comp.hkbu.edu.hk/docs/o/dl/web/B10926_01/java_xsu.htm#1005249
It says:
"getXMLString()
Transforms the object-relational data, specified in the constructor, into a XML document. "

I doensn't speak about structure, but about data.
0
 
vihar123Author Commented:
is there something wrong with my code, how should i solve this problem of exceeding key size?????

well its retreiving the data properly and i have made the inserting table with same specifications, still its giving me the same exception.

can somebody provide some ideas
0
 
Giant2Commented:
Now I see your code:
It's little wrong. You do not save in the file what you read from the db.
Try this:
      public static void main(String args[]) throws SQLException {
            Connection conn;
            try {
                  OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");
                  String sx = qry.getXMLString();
                  System.out.println(sx);
                  //              table into whichi, the data would be inserted//
                  String tableName = "employee";
                  String fileName = "emps.xml";
                  try {
                        //writing to file
                        BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
                        out.write(sx);
                        out.close();
                  } catch (IOException e) {System.out.println(e);}
                  //inserting data from xml into database table//
                  OracleXMLSave save = new OracleXMLSave(conn, tableName);
                  URL url = OracleXMLSave.getURL(fileName);

                  System.out.println("success");
                  conn.close();
            } catch (SQLException e) {
                  System.out.println(e);
            }
      }
0
 
vihar123Author Commented:
thanks but even after trying this its giving me the same error "exceeding key size"

OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");
                              String sx = qry.getXMLString();
                              System.out.println(sx);
                              
                              //table into whichi, the data would be inserted//
                              String tableName = "employee";
                              String fileName = "emps.xml";
                              
                              //inserting data from xml into database table//
                              try {
                          //writing to file
                    BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
                    out.write(sx);
                                           
                    out.close();
                    }
                                     catch (IOException e) {System.out.println(e);}

                              OracleXMLSave save = new OracleXMLSave(conn, tableName);
                              URL url=OracleXMLSave.getURL(fileName);
                              int rowCount = save.insertXML(url);
                              
                                                         
                              System.out.println("success");
                              conn.close();
                              
                                }
                                
                                       catch (SQLException e)
                                         {
                                          System.out.println(e);
                                                  }
       
    }
}
0
 
Giant2Commented:
What is the full error message?
Normally is ORA-____ message
What is your?
0
 
vihar123Author Commented:
java.sql.SQLException: Exceding key size

its just giving this output after running, thats all
0
 
zzynxSoftware engineerCommented:
ORA-17413
0
 
Giant2Commented:
try to put a System.out here:
               OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");
               System.out.println("Hi I'm here!!!");//-------------------------insert this line
               String sx = qry.getXMLString();
               System.out.println(sx);
0
 
vihar123Author Commented:
>>>System.out.println("Hi I'm here!!!");//-------------------------insert this line

its giving the same error, so actually its not retreiving......
0
 
zzynxSoftware engineerCommented:
>> Complete stack dump please

Could you add the following line in the catch block to procuce more error info:

 } catch (SQLException e) {
        e.printStackTrace();          // <<<<<<<<< add this line
        System.out.println(e);
 }

0
 
zzynxSoftware engineerCommented:
>> its giving the same error, so actually its not retreiving......
Wrong conclusion.
Add the line I suggested and tell us what it is printing
0
 
Giant2Commented:
and tell us the full dump it gave, like:
blablabla.....
...
.
Error

thanks.
0
 
vihar123Author Commented:
well the problem lies with classes111, when i deleted it, its no more giving the error, atleast retreiving is going fine.

but for inserting its asking for classes111

strange exceptions****
0
 
Giant2Commented:
>strange exceptions****
What exceptions?!?!? Post them, please.

After this try to replace the place in which you insert into db with the following:

OracleXMLSave save = new OracleXMLSave(conn, tableName);
InputStream is = new FileInputStream(fileName);
int rowCount = save.insertXML(is);

0
 
zzynxSoftware engineerCommented:
Could you tell us the output result of printStackTrace()?
0
 
vihar123Author Commented:
>>>After this try to replace the place in which you insert into db with the following:


>>> What exceptions?!?!?

java.lang.NoClassDefFoundError: oracle/jdbc2/Clob
        at testxml2.main(testxml2.java:39)
Exception in thread "main"


---------------


OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");
                              System.out.println("Hi I'm here!!!");
                              String sx = qry.getXMLString();
                              //System.out.println(sx);
                                
                                
                                 String tableName = "employee";
                              String fileName = "emps.xml";
                              
                                  OracleXMLSave save = new OracleXMLSave(conn, tableName);
                                    
                                    try {
                          //writing to file
                          InputStream is = new FileInputStream(fileName);
                    BufferedWriter out = new BufferedWriter(new FileWriter(fileName));
                    out.write(sx);
                 //System.out.println("hi");
                     int rowCount = save.insertXML(is);      
                    out.close();
                    }
                                     catch (IOException e) {System.out.println(e);}

                                    
                                                 
                                           
                   
                    }
                                                                     catch (SQLException e)
                                         {
                                          System.out.println(e);
                                                  }
       
    }
}
0
 
zzynxSoftware engineerCommented:
Please, could you tell us the output result of ******printStackTrace()******?
0
 
Giant2Commented:
are you downloaded and installed the correct Oracle-XDK ?
I seems your XKD installation is not done correctly.
the jar file containing your Clob class could be part of XDK environment.
Try to reinstall it.

See here:
http://www.oracle.com/technology/tech/xml/xdk/doc/production/java/index.html
0
 
vihar123Author Commented:
>>>Please, could you tell us the output result of ******printStackTrace()******?

well i tried this, but its now showing anything except this error

Hi I'm here!!!
hi
java.lang.NoClassDefFoundError: oracle/jdbc2/Clob
        at testxml2.main(testxml2.java:39)
Exception in thread "main"
 
-----------------

OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");
                              System.out.println("Hi I'm here!!!");
                              String sx = qry.getXMLString();
                              System.out.println("hi");
                                
                                
                              String tableName = "employee";
                              String fileName = "emps.xml";
                              try {
                                  OracleXMLSave save = new OracleXMLSave(conn, tableName);
                                  InputStream is = new FileInputStream(fileName);
                                          int rowCount = save.insertXML(is);
                                          is.close();
                    }
                                     catch (IOException e) {System.out.println(e);
                                      }

                                                                   
                                                                  }
                             catch (SQLException e)
                                         {
                                          e.printStackTrace();      
                                      
                                          System.out.println(e);
                                          
                                                  }
       
    }
}      
0
 
Giant2Commented:
It seems to me that the XDK doesn't correctly installed.

In XDK there is a jar with oracle/jdbc2/clob (I don't remember where, I used many times ago and now the Oracle site is partially down)
0
 
vihar123Author Commented:
ok ill try to re install it and try again. the right way of installing i think is to extract and put in the ext folder?
0
 
Giant2Commented:
yes. In the ext folder of the jdk/jre you use to run.
0
 
Giant2Commented:
to be sure you use the correct XDK you can extract all in a specific folder and then add this folder (and all the jar/zip file) to the classapth.

java -classapth..........
0
 
Giant2Commented:
the ext directory is only for JRE not for JDK. So I believe (to do not make a mistake) extract all in a specific folder and then add this folder (and all the jar/zip file) to the classapth.

Hope this help you.
Bye, Giant.
0
 
vihar123Author Commented:
>>>the ext directory is only for JRE not for JDK. So I believe (to do not make a mistake) extract all in a specific folder and then add this folder (and all the jar/zip file) to the classapth.

so, does that means I shouldnt add it in the ext folder "c:\j2sdk1.4.2_03\jre\lib\ext" ???????????????
0
 
Giant2Commented:
are you using JRE or JDK for run?
0
 
zzynxSoftware engineerCommented:
>> so, does that means I shouldnt add it in the ext folder "c:\j2sdk1.4.2_03\jre\lib\ext" ???????????????
No. Adding it to the c:\j2sdk1.4.2_03\jre\lib\ext folder is OK.
It's just an alternative to setting the class path.

>>are you using JRE or JDK for run?
If you run it via the JRE of course. That is: if you don't run it from within your IDE (if you're using one)
0
 
vihar123Author Commented:
>>>are you using JRE or JDK for run?

could be stupid question, but can you tell me how to know this if I am running jdk or jre
0
 
Giant2Commented:
from the code you post I see it's an application (not applet), so could you post the path you use?
I believe when you run this application you do:
java testxml

if we see the path you use we can know if you are using JDK or JRE.
0
 
vihar123Author Commented:
im using a tool called java beginner, and it gives something like this.




java -classpath I:\Gotla\java;C:\j2sdk1.4.2_03\jre\lib\charsets.jar;C:\j2sdk1.4.2_03\jre\lib\classes12.jar;C:\j2sdk1.4.2_03\jre\lib\jce.jar;C:\j2sdk1.4.2_03\jre\lib\jsse.jar;C:\j2sdk1.4.2_03\jre\lib\plugin.jar;C:\j2sdk1.4.2_03\jre\lib\rt.jar;C:\j2sdk1.4.2_03\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_03\jre\lib\ext\bin;C:\j2sdk1.4.2_03\jre\lib\ext\classes12.jar;C:\j2sdk1.4.2_03\jre\lib\ext\classgen.jar;C:\j2sdk1.4.2_03\jre\lib\ext\dms2Server.jar;C:\j2sdk1.4.2_03\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_03\jre\lib\ext\jdev-rt;C:\j2sdk1.4.2_03\jre\lib\ext\jdev-rt.zip;C:\j2sdk1.4.2_03\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.2_03\jre\lib\ext\lib;C:\j2sdk1.4.2_03\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_03\jre\lib\ext\oraclexsql.jar;C:\j2sdk1.4.2_03\jre\lib\ext\samples.jar;C:\j2sdk1.4.2_03\jre\lib\ext\servlet.jar;C:\j2sdk1.4.2_03\jre\lib\ext\soap.jar;C:\j2sdk1.4.2_03\jre\lib\ext\sunjce_provider.jar;C:\j2sdk1.4.2_03\jre\lib\ext\transx;C:\j2sdk1.4.2_03\jre\lib\ext\transx.zip;C:\j2sdk1.4.2_03\jre\lib\ext\xdb.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xdk;C:\j2sdk1.4.2_03\jre\lib\ext\xmlcomp.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xmlcomp2.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xmlmesg.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xmlparserv2.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xschema.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsqlserializers.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu111.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu111_816.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu111_817.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu12.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu12_816.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu12_817.jar;C:\Progra~1\JavaBeginner\samples; testxml2
0
 
Giant2Commented:
java beginner? I don't know it.
But if you open the command-prompt, go to your develop directory and type java testxml2 what is the result?
0
 
vihar123Author Commented:
>>But if you open the command-prompt, go to your develop directory and type java testxml2 what is the result?

result:-

I:\per\java>java testxml2
Hi I'm here!!!
hi
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc2/Clob
        at testxml2.main(testxml2.java:39)
0
 
Giant2Commented:
do this (from the prompt):
echo %PATH%
0
 
vihar123Author Commented:
>>>echo %PATH%

C:\j2sdk1.4.2_03\bin;C:\orant\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\W
bem;C:\Program Files\perl\bin;C:\Program Files\it_sec\iT_SEC_Shared
0
 
Giant2Commented:
ok.
now do this:
java - version

and tell me where you have installed your XDK (and the jar file contained in it)
0
 
zzynxSoftware engineerCommented:
You can let your own program print out the version and the class path as follows:

System.out.println( "Java version =" + System.getProperty("java.version") );
System.out.println( "Class path = " + System.getProperty("java.class.path") );

>>tell me where you have installed your XDK (and the jar file contained in it)
Thought he told us:
      >> >>the right way of installing i think is to extract and put in the ext folder?
      >> yes. In the ext folder of the jdk/jre you use to run.
0
 
Giant2Commented:
The thing I try to guide to you is the following:
java -classpath <here all the jar you have in the XDK separated by ;> testxml2

if the java is not the correct I'll guide you to do:
C:\j2sdk1.4.2_03\bin\java -classpath <here all the jar you have in the XDK separated by ;> testxm


zzynx, I do not understand what you are saying.
0
 
vihar123Author Commented:
Java version =1.4.2_03

C:\j2sdk1.4.2_03\jre\lib\ext\xdk
0
 
zzynxSoftware engineerCommented:
>> zzynx, I do not understand what you are saying.
If you let him add the lines

      >>System.out.println( "Java version =" + System.getProperty("java.version") );
      >>System.out.println( "Class path = " + System.getProperty("java.class.path") );

to his code (e.g. at the beginning instead of the "Hi I'm there"),
then no matter how or from where it is run, it will give you the version and class path
that is used at the moment of running the program.

vihar, I think you should place all XDK jar files in
        C:\j2sdk1.4.2_03\jre\lib\ext
not in
        C:\j2sdk1.4.2_03\jre\lib\ext\xdk
0
 
vihar123Author Commented:
>>>   C:\j2sdk1.4.2_03\jre\lib\ext

they are already placed
0
 
zzynxSoftware engineerCommented:
>>they are already placed
Sure?
Doesn't that conflict with what you are saying here:
     >>>> tell me where you have installed your XDK (and the jar file contained in it)
     >>C:\j2sdk1.4.2_03\jre\lib\ext\xdk
0
 
vihar123Author Commented:
Doesn't that conflict with what you are saying here:
     >>>> tell me where you have installed your XDK (and the jar file contained in it)
     >>C:\j2sdk1.4.2_03\jre\lib\ext\xdk

all those jar files that where in lib folder i cut and copied to the ext folder........
0
 
Giant2Commented:
the Oracle JDBC driver you must use is:
ojdbc14.jar (and not classes111.zip)
available on Oracle site (today goes)
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
0
 
zzynxSoftware engineerCommented:
>> the Oracle JDBC driver you must use is:
>> ojdbc14.jar (and not classes111.zip)

Could be right. So try:
- delete (or move again) all jar files that you copied to C:\j2sdk1.4.2_03\jre\lib\ext
- place the ojdbc14.jar in C:\j2sdk1.4.2_03\jre\lib\ext
0
 
Giant2Commented:
>- delete (or move again) all jar files that you copied to C:\j2sdk1.4.2_03\jre\lib\ext
Not really right.
In the classpath must be present the XDK jar and jdbc-odbc jar.
I say "must be ojdbc14.jar" because the jdbc-odbc suggested in the Oracle site is this and not classes111.zip
I try to download both and I see that only classes111.zip contains oracle/jdbc2/... So I suppose that you are using this last (wrong) jar.
0
 
vihar123Author Commented:
Hi,
i tried my best to get this ojdbc14.jar, but couldnt get, i think the official site server is dowm, does anybody have it in some public domain......can somebody help me to get this :-)
thanks
0
 
Giant2Commented:
No, the Oracle site is Up! I can now download it from the Oracle Site:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
0
 
zzynxSoftware engineerCommented:
>> does anybody have it in some public domain
http://www3.dropload.com/redeem.php?t=588b1437e3739eac6f7eea88adc08980
0
 
vihar123Author Commented:
>> does anybody have it in some public domain
http://www3.dropload.com/redeem.php?t=588b1437e3739eac6f7eea88adc08980

>>>>>>>>>>>>>>>>>>its showing this message

File Pickup
The file "ojdbc14.jar" was picked up on 2004-09-16 03:50:09. Please contact the person who sent you this link if there's been some sort of mistake.

0
 
zzynxSoftware engineerCommented:
Seems like someone else downloaded it already.
Another try: http://www.dropload.com/redeem.php?t=350f477b360957e16f568de959e0371a
0
 
vihar123Author Commented:

thanks zzynx, i could download, hope it works now :-)
0
 
zzynxSoftware engineerCommented:
I really hope it for you...
0
 
vihar123Author Commented:
I place the jar file in ext, C:\j2sdk1.4.2_03\jre\lib\ext\ojdbc14.jar ----but its still giving the same exception

java.lang.NoClassDefFoundError: oracle/jdbc2/Clob
        at testxml2.main(testxml2.java:42)
Exception in thread "main"
0
 
zzynxSoftware engineerCommented:
Damn, what an obstinate problem!

Could you add

      System.out.println( "Java version =" + System.getProperty("java.version") );
      System.out.println( "Class path = " + System.getProperty("java.class.path") );

after

     OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from emp1");

and copy/paste the resulting output once again?
0
 
vihar123Author Commented:
even i feel the same, this error has been troubling me since yesterday....
-----------------------------

Java version =1.4.2_03
Class path = I:\Gotla\java;C:\j2sdk1.4.2_03\jre\lib\charsets.jar;C:\j2sdk1.4.2_03\jre\lib\classes12.jar;C:\j2sdk1.4.2_03\jre\lib\jce.jar;C:\j2sdk1.4.2_03\jre\lib\jsse.jar;C:\j2sdk1.4.2_03\jre\lib\plugin.jar;C:\j2sdk1.4.2_03\jre\lib\rt.jar;C:\j2sdk1.4.2_03\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_03\jre\lib\ext\bin;C:\j2sdk1.4.2_03\jre\lib\ext\charsets.jar;C:\j2sdk1.4.2_03\jre\lib\ext\classgen.jar;C:\j2sdk1.4.2_03\jre\lib\ext\dms2Server.jar;C:\j2sdk1.4.2_03\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_03\jre\lib\ext\jce.jar;C:\j2sdk1.4.2_03\jre\lib\ext\jdev-rt;C:\j2sdk1.4.2_03\jre\lib\ext\jdev-rt.zip;C:\j2sdk1.4.2_03\jre\lib\ext\jsse.jar;C:\j2sdk1.4.2_03\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.2_03\jre\lib\ext\lib;C:\j2sdk1.4.2_03\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_03\jre\lib\ext\ojdbc14.jar;C:\j2sdk1.4.2_03\jre\lib\ext\oraclexsql.jar;C:\j2sdk1.4.2_03\jre\lib\ext\plugin.jar;C:\j2sdk1.4.2_03\jre\lib\ext\rt.jar;C:\j2sdk1.4.2_03\jre\lib\ext\samples.jar;C:\j2sdk1.4.2_03\jre\lib\ext\servlet.jar;C:\j2sdk1.4.2_03\jre\lib\ext\soap.jar;C:\j2sdk1.4.2_03\jre\lib\ext\sunjce_provider.jar;C:\j2sdk1.4.2_03\jre\lib\ext\sunrsasign.jar;C:\j2sdk1.4.2_03\jre\lib\ext\transx;C:\j2sdk1.4.2_03\jre\lib\ext\transx.zip;C:\j2sdk1.4.2_03\jre\lib\ext\xdb.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xdk;C:\j2sdk1.4.2_03\jre\lib\ext\xmlcomp.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xmlcomp2.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xmlmesg.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xmlparserv2.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xschema.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsqlserializers.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu111.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu111_816.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu111_817.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu12.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu12_816.jar;C:\j2sdk1.4.2_03\jre\lib\ext\xsu12_817.jar;C:\Progra~1\JavaBeginner\samples;
Hi I'm here!!!
hi
java.lang.NoClassDefFoundError: oracle/jdbc2/Clob
        at testxml2.main(testxml2.java:43)
Exception in thread "main"
0
 
zzynxSoftware engineerCommented:
Almost out of ideas... :°(

I think your small app incorrectly uses some older classes that shouldn't be there anymore.
E.g. I see  xsu111.jar, xsu111_816.jar, xsu111_817.jar, xsu12.jar, xsu12_816.jar and xsu12_817.jar
      Sure *all* are needed?

I think in that direction. Mere intuition though
0
 
vihar123Author Commented:
>>>Sure *all* are needed?

i tried to play around taking them, one by one and all at a time, programm is not identifying some packages like oracle.xml.sql.

so shld i post this as a new question to get more contributions or it doesnt make difference?
0
 
Giant2Commented:
Last question.
Do you use OCI or Thin to connect?
If you use OCI you must download even the appropriate set of dll.

From all the post I see that jdbc2 is used to do all and these classes are present only in classes111.jar, but this is for Java1 and you use Java2.
I think some other things must be installed (an XDK recent, for example). I seed the code and it's not uncorrect. It's the code suggested in the newgroup and in the example.
0
 
vihar123Author Commented:
im using thin
conn = DriverManager.getConnection ("jdbc:oracle:thin:----------------)
0
 
zzynxSoftware engineerCommented:
>> shld i post this as a new question to get more contributions or it doesnt make difference?
Closing this Q and posting it as a new question would certainly attract the attention of more experts
than just the two of us.
0
 
vihar123Author Commented:
ok i think ill ask it as a new question

thanks for everything.
0
 
zzynxSoftware engineerCommented:
Thanks for accepting,
but I think the solution of your first problem really deserved an A grade
0
 
Giant2Commented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.