SAX Parser for Oracle 8.1.5

I need SAX parser - i want load this class into DB. Any ideas?
Adam

Have i possibilities to using some javatypes in oracle java stored procedure if this class is not loaded into db?
Cause i would like to create a java stored procedure to parse and insert some data from xml. I was thinking to pass xml file name as a parameter to my java procedure.
I must use Oracle 8.1.5 with jdk 1.1.7, and the best parser for me is SAX.
Please help.
Have i possobilities to use class inside oracle, which are placed outside oracle?
Something like classpath, where can i modify value (but classpath inside oracle)?

Similar Messages

  • Java +XML (SAX) Parser for Oracle 8.1.5 EE

    Hi there :)
    I am looking java classes for SAX to parse XML. I cannot find a valid parser, cause after downloaded from Oracle XDK for java, when i try to load this calasses i get a messages that i alot of classes connot be resolved.
    If somebody have valid classes on Ora 8.1.5 please send me mail.
    Adam

    Have i possibilities to using some javatypes in oracle java stored procedure if this class is not loaded into db?
    Cause i would like to create a java stored procedure to parse and insert some data from xml. I was thinking to pass xml file name as a parameter to my java procedure.
    I must use Oracle 8.1.5 with jdk 1.1.7, and the best parser for me is SAX.
    Please help.
    Have i possobilities to use class inside oracle, which are placed outside oracle?
    Something like classpath, where can i modify value (but classpath inside oracle)?

  • SAX Parser for Oracle 8.1.5 needed!!! Urgent

    Please help.
    If you know something please send me mail.
    Regards
    Kail

    Would you tell us how your will use SAX parser?

  • Sax Parser for loading XML file

    We have a requirment by which we need to load huge XMl file in our DB everyday.
    THe XML file format is like --
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <emp>
    <ename>aaa</ename>
    <sal>3000</sal>
    </emp>
    <emp>
    <ename>bbb</ename>
    <sal>5000</sal>
    </emp>
    <dept>
    <name>productiong</name>
    <location>USA</location>
    <dept>
    I have written XMl SAX parser to load this file into DB -
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.XMLReader;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.Attributes;
    import java.io.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.OracleDataSource;
    import java.util.*;
    public class test extends DefaultHandler
    String thisElement="";
    String table_name="";
    String table_name_2="";
    String sql="";
    String value_clause="";
    StringBuffer value_clauseBuffer;
    String Insert_sql="";
    int flag;
    String columnNames="";
    String questionmarks="";
    static String conStr = "jdbc:oracle:thin:@abcd1234:1521:dss501";
    static Connection conn;
    String arrayValues[] = new String[30];
    int j = 0;
    int emptyElementFlag = 0;
    public SurveyReader() throws SQLException, FileNotFoundException, IOException{
    DBConnect("username", "password");
    public static void DBConnect(String username, String password)
    throws SQLException, FileNotFoundException, IOException {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(conStr, username, password);
    conn.setAutoCommit(true);
    public void startElement(String namespaceURI, String localName,
    String qName, Attributes atts) throws SAXException {
    thisElement = qName;
    if (thisElement!=table_name){
    columnNames = columnNames + ", " + qName;
    questionmarks = questionmarks +", " + "?";
    emptyElementFlag =0;
    public void characters(char[] ch, int start, int length)
    throws SAXException {
    if (thisElement !="root"){     
    if ((length == 0) && (thisElement !="") ){
    table_name = thisElement;
    sql = " Insert into "+ table_name +"(";
    value_clause="";
    value_clauseBuffer =null;
    columnNames = "";
    questionmarks ="";
    j =0;
    if ((length != 0) && (thisElement!="") && (thisElement!=table_name)){
    emptyElementFlag = 1;
    String s = new String(ch, start, length);
    String newString = s.replaceAll("'", "''");
    // String newString = s;
    if (value_clauseBuffer== null){
    value_clauseBuffer = new StringBuffer(newString);
    else{
    value_clauseBuffer.append(newString);
    public void endElement(String namespaceURI, String localName, String qName)
    throws SAXException {
    if (thisElement !="root"){
    if ((!(value_clauseBuffer == null))||((emptyElementFlag ==0) && (qName !=table_name))) {
    try{
    //value_clauseBuffer.append("', '");
    if (value_clauseBuffer == null){
    arrayValues[j]="";
    else{
    arrayValues[j]=""+value_clauseBuffer;
    j = j+1;
    value_clauseBuffer = null;
    emptyElementFlag =0;
    }catch(Exception e){
    System.err.println(e);
    System.exit(2);
    if (qName == table_name){
    if (!(value_clauseBuffer == null)){
    value_clause = "'"+value_clauseBuffer;
    columnNames =columnNames.substring(1, columnNames.length());
    int paramNumber = j;
    questionmarks =questionmarks.substring(1, questionmarks.length());
    sql = sql + columnNames + " ) values (" + questionmarks +"); ";
    Insert_sql=Insert_sql + sql;
    sql = "Begin "+sql + " End; ";
         try{
         PreparedStatement pstat = conn.prepareStatement(sql);
    for (int i=0; i<=j-1; i++ ){
    int k = i+1;
    pstat.setObject(k, arrayValues);
         ResultSet rset = pstat.executeQuery();
         rset.close();
         pstat.close();
    catch (Exception e) {
    System.err.println(e);
    System.out.print("sql " + sql);
    System.exit(1);
    table_name_2 = table_name;
    thisElement = "";
    public static void main (String args[]) {
    XMLReader xmlReader = null;
    System.out.println("Time " + new java.util.Date());
    try {
    SAXParserFactory spfactory = SAXParserFactory.newInstance();
    spfactory.setValidating(false);
    SAXParser saxParser = spfactory.newSAXParser();
    xmlReader = saxParser.getXMLReader();
    xmlReader.setContentHandler(new SurveyReader());
    xmlReader.setErrorHandler(new SurveyReader());
    InputSource source = new InputSource("short.xml");
    xmlReader.parse(source);
    conn.close();
    } catch (Exception e) {
    System.err.println(e);
    System.exit(1);
    This parser takes 2 hours to laod file of size around 8MB.
    ANy suggestions on improving performance of the parser.
    ANy other approach I should be taking to load this file into DB.
    We are using ORacle 9i DB with Character set UTF 8.
    Thanks!

    String buf = (new String(ch, start, length)).trim();
    if (thisElement != "root"){   
    if ((buf.length() == 0) && (thisElement !="") ){
    It run ok!
    Thanks 58871!
    Now, i want to export oracle table to xml file like :
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <emp>
    <ename>aaa</ename>
    <sal>3000</sal>
    </emp>
    <emp>
    <ename>bbb</ename>
    <sal>5000</sal>
    </emp>
    </root>
    Can SAX export to xml format?
    Pham Thanh Tung

  • SAX parser for PL/SQL

    For a long time on technet the
    PL/SQL parser release notes have
    said that they will be supporting
    SAX in a future release. Is there
    any idea of when this support may
    materialize? Or is Java the only
    option for a parser in the db for
    the near future that can handle large
    documents?
    null

    What would you want to use as the implementation of the SAX2 ContentHandler interface in PL/SQL? Stored procedure-based callbacks? Just curious how you would envision this working. Your input is valuable to our future thinking in this area. Most teams using PL/SQL that want to use SAX have written Java Stored Procedures that use SAX internally inside the stored procedure (written in Java) but are not doing the SAX parsing with PL/SQL-based callbacks.

  • AGAIN - Needed SAX parser for java on Oracle 8.1.5

    like in subject.
    I load succesful sax2, but i need load more useful parser like from oracle or ibm.
    But when i try i get a lot of errors like ORA-29534 (NullPointerOperation).
    Kail

    Only XML Parser v2 release 2.0.2.7 from Oracle works in 8.1.5, and this release does not support SAX2 unfortunately.

  • XML parser for Oracle 8i

    I would like to use XMLparser for plsql in Oracle 8i. I know that I can download the parser from the OTN. Can anyone tell me how to install it to Oracle8i? or does Oracle 8i DBMS already has one installed/embedded into it as the default DBMS.
    Furthermore, the directions in OTN tells us to install JKD1.1.x or above and GNUgzip?
    Why do I have to install JDK to use the parser? and what is GNU gzip?
    Thank you very much
    Ben

    There is a readme file in that package which
    show you how to install it into your Oracle8i
    database.
    Duy

  • SAX Parser For XML

    Hello all,
    I am trying Parsing XML thorugh SAX. Were to get SJXP.jar and parser.jar files on sun site
    if any body have these files plz mail :[email protected]

    String buf = (new String(ch, start, length)).trim();
    if (thisElement != "root"){   
    if ((buf.length() == 0) && (thisElement !="") ){
    It run ok!
    Thanks 58871!
    Now, i want to export oracle table to xml file like :
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <emp>
    <ename>aaa</ename>
    <sal>3000</sal>
    </emp>
    <emp>
    <ename>bbb</ename>
    <sal>5000</sal>
    </emp>
    </root>
    Can SAX export to xml format?
    Pham Thanh Tung

  • How to conevrt a Document into InoutSource for SAX parsing

    I was trying to perform SAX parsing for a Document.
    Can anybody help me out?
    regards,
    Ranjan

    I need it because I have two big Documents with cross references depending upon business requirement. If I am doing DOM manilation then its very expensive in terms of performance. So I want to perform a SAX parsing.
    One way to achieve this it to perform Transformation with
    SAXResult result = new SAXResult(conHandler);//this is my DefaultHandler
    transformer.transform(dsource,result); //dsource is the DOM source of my first Document
    Is the any otherway around?
    regards,
    Ranjan

  • Xml sax parser

    Hi all,
    I am newbie to xml. I am using SAX parser for parsing xml documents. I have to write a code which parses all types of xsd files(including which can contain inline , referenced or both). Can anyone help / guide me how to code a generic xsd parser??
    Thanks in advance,

    An XSD file is an XML file, so you can parse it using sax.
    See :
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/work/Echo02.java
    See also:
    http://www.oracle.com/technology/tech/xml/xdk/doc/production/java/doc/java/javadoc/oracle/xml/parser/schema/XMLSchema.html#getXMLSchemaNodeTable

  • SAX parser splits up character data; I expected Ign. whitesp

    Im am working on a XML parser for loading data from some back
    end systems into an Oracle 8i database. I am using the SAX
    parser for this purpose. After doing some tests with larger
    amounts of XML data (> 1M), I found some unexpected behaviour.
    The parser sometimes splits up character data into two chunks of
    data. The XML looks as follows:
    <TAGNAME> this is the character data </TAGNAME>
    The parser raises the following events:
    1 startElement name = "TAGNAME"
    2 characters chbuf = " "
    3 characters chbuf = "this is the character data "
    4 endElement name = "TAGNAME"
    I expected an ignorableWhitespace event at step 2. The XML
    document contains repetitive tagnames. The strange thing about
    the parse process is that the parser splits up the character
    data only sometimes, and I can't determine any kind of logica
    for this behaviour. Most occurrences of exactly the same tagname
    and character data are parsed correctly (that is, as I
    expected).
    Am I dealing with correct behaviour here, or is it a bug??
    Rolf.
    null

    Oracle XML Team wrote:
    : Rolf van Deursen (guest) wrote:
    : : Im am working on a XML parser for loading data from some
    back
    : : end systems into an Oracle 8i database. I am using the SAX
    : : parser for this purpose. After doing some tests with larger
    : : amounts of XML data (> 1M), I found some unexpected
    behaviour.
    : : The parser sometimes splits up character data into two
    chunks
    : of
    : : data. The XML looks as follows:
    : : <TAGNAME> this is the character data </TAGNAME>
    : : The parser raises the following events:
    : : 1 startElement name = "TAGNAME"
    : : 2 characters chbuf = " "
    : : 3 characters chbuf = "this is the character data "
    : : 4 endElement name = "TAGNAME"
    : : I expected an ignorableWhitespace event at step 2. The XML
    : : document contains repetitive tagnames. The strange thing
    about
    : : the parse process is that the parser splits up the character
    : : data only sometimes, and I can't determine any kind of
    logica
    : : for this behaviour. Most occurrences of exactly the same
    : tagname
    : : and character data are parsed correctly (that is, as I
    : : expected).
    : : Am I dealing with correct behaviour here, or is it a bug??
    : : Rolf.
    : The behavior is expected and correct. Could you elaborate on
    why
    : you would expect the parser to treat the whitespace signalled
    in
    : step 2 as ignorable?
    : Oracle XML Team
    : http://technet.oracle.com
    : Oracle Technology Network
    Thank you for your quick response.
    In my test XML, there are about 27500 tags containing character
    data. All character data starts with a whitespace character.
    After parsing the xml, the whitespace of only 5 (!) tags is
    treated as a seperate character event (so two character events
    are raised in succession). The remaining tags all raise only ONE
    character event for the entire character data. I can't explain
    the difference in treatment.
    null

  • SAX Parsing in Adapter Module

    Hi All,
    I need to build a custom Adapter Module where i want to use SAX Parsing for parsing XML document. I tried with a piece of Code but i'm getting following error while running the same:
    Error occurred while sending message (GUID 6da4ff1c-3736-4990-1881-a8f09edd5fde): null
    When i check the Audit Log the i just see following two lines:
    Success Channel JDBC_s_Article_Grp1: Query executed successfully and confirmation skipped. Data may be sent again ("TEST" mode)
    Send query result. Size: 1398556 characters
    There are no logs being created for module at all. Also when i run the same code with DOM parsing, it works perfectly fine.
    I have tries with re-deployment multiple times but no result.
    Any pointers?
    Regards,
    Anurag

    try to handle exceptions and use logging to know what the issue is.
    That is the best way to troubleshoot your code
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a?quicklink=index&overridelayout=true
    refer section 4.4.2 Writing Audit Logs

  • I've a problem with errors message in the sax parser

    Hello,
    I'm quite new to Java.
    I'm trying to create a SAX parser for my XML file, with a XML schema.
    When my pars run a XML file, the following mistakes go out:
    1)org.sax.SAXParseException:s4s-elt-must-match: the content of 'restriction' must match (annotation?,.....)
    2)org.sax.SAXParseException: src-ct.0.1:Complex Type Definition Rappresentation Error for type..... Element 'sequence' is invalid,misplaced or occurs to often
    but I don't understand where I must go in the schema to correct.
    Many thanks!

    Hi,
    Perhaps it would help if you post your XML file.

  • SAX Parser method charaters trouble

    Hi,
    I am using a sax parser for loading an xml file of size over 1gb. The problem whats happening is that the content gets truncated at random.
    And this truncation happens in the characters method of the sax parser. This am sure as I logged the content I get from characters method before starting my processing. for ex:
    <content>signal1,signal960</content>
    <content>signal1,signal970</content>
    On parsing the above snippet, the first content "signal1,signal960"
    gets extracted completely, however the next one is truncated, and the truncation is random. This happens for some tags, and then the extraction resumes normally. And this truncation starts occuring again after it has extracted a few tags.
    Also the first truncation started occuring only after parsing around 200 mb of the 1gb file.
    Could anyone tell if there is some limitation with XERCES or CRIMSON.
    or if any other one that I can use???
    Regards,
    R.

    To quote from the Documentation of ContentHandler.characters:
    -- start quote --
    The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
    -- end quote --
    So providing the content in two seperate calls is perfectly valid and must be handled by your code. It's probably a result of the internal workings of the XML parser and allowing that in the Parser specification probably allowed some optimizations that would otherwise be impossible (a constant buffer size, for example).

  • Using the SAX parser to split up a document to be processed by a DOMParser

    I need to process a potentially large document which could prove too large to be read into memory at once by the DOM parser. The document would look something like..
    (sorry about the formatting - can't use tabs!)
    <Root>
    <Parent>
    <Child>
    <Blah.....................
    </Blah>
    </Child>
    </Parent>
    <Parent>
    <Child.......
    </Child>
    </Parent>
    etc...
    etc...
    </Root>
    The number of Parent elements could potentially be in the thousands. What I would like to do would be to use the SAX parser to read the document and when a Parent element is encountered, write the parent element and all its children to a stream in order that an input source can be created. The input source can then be parsed by a DOM parser. Once complete, the next Parent element encountered by the SAX parser could be passed to the DOM parser and so on until all of the Parent elements have been processed.
    This way I can combine the ease of parsing the document using the DOM parser without having to worry about the overhead on memory.
    Does anyone have any ideas as to the best approach? I could use the SAX parser for the whole thing but the XML is quite complex and lends itself to DOM parsing much more conveniently.

    Can you read the file line by line:
    start the reading at <child>
    pause reading at </child>
    copy the string to a var
    wrap it with respective tags (<?xml<doctype etc...) and parse
    proceed to the next <child>xx</child>
    and repeat till you hit the closing of the file...
    - Ravi

Maybe you are looking for

  • Extremely low message throughput with MQ 3.6

    We performed some load tests to determine maximum throughput of the Sun JMS framework when used in conditions similar to our application. The achieved throughput is extremely low: around 10 messages / second while we expected around 100. Could you pl

  • Cannot see any Wireless networks

    After installing the latest security update for 10.3.9, I can no longer see any wireless networks. I have tried reseating my airport card along with unpluging the antenna with no luck. I have also repaired permissions and trashed the Network Interfac

  • Trying to sort library by file type

    Hey all, I'm trying to sort by file type so it can quickly arrange all the TIFF files together in one easy to see group. I'm not sure if I am doing something wrong here, because it keeps just slightly rearranging my images, but not putting all TIFF t

  • HT1420 It keeps telling me that I have more than 5 computers authorized, but I do not?

    It keeps telling me that I have 5 computers authorized, but I do not have 5 computers.

  • 7.0.7.5 HotFix

    Has anyone seen any issues when installing this HF and checking the Update Client Component Automatically. With it checked I get a dll mismatch error, and CDT will not load.  With it unchecked, it works properly and CDT loads.  Also, If I uninstall 7