How to save and retrive XML DOM to/from SQLServer

Hi, there,
I am new to JAVA, and now I'm trying to save a large XML DOM to SQLServer, and retrive it as a XML DOM later. Would someone please let me know how can I do it?
Thanks!
----YM

You would be better looking at the XML DOM documentation for your database rather than asking here. If your DB doesn't provide XML facilities, then there are products and techniques that can be applied to map XML to SQL, and you can always serialize the java objects into a blob, but XML to SQL mapping isn't standardized, so the first call is the server's documentation.

Similar Messages

  • How to SAVE a updated XML DOM Data to the file?

    Hi
    I am able to load an XML file into a XML DOM object using JAVA (xerces). I have update the required data in the DOM.
    But I am NOT able to save back the data to the physical file.
    Will appreciate if you can help me ASAP.

    Hi Krishar,
    Check out the jaxp new release on java.sun.com. This api has classes and methods to help you do the same.
    sample code:
         try
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              java.net.URL url = this.getClass().getResource(XML_FILE);
              java.io.File thsFile = new java.io.File(url.getFile());
              DocumentBuilder builder = factory.newDocumentBuilder();
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer();
              document = builder.parse(thsFile);
    //You can do any modification to the document here
              DOMSource source = new DOMSource(document);
              StreamResult result = new StreamResult(thsFile);
              transformer.transform(source, result);
         catch (TransformerConfigurationException tce)
              System.out.println("\n** Transformer Factory error");
              System.out.println(" " + tce.getMessage());
              Throwable x = tce;
              if (tce.getException() != null)
                   x = tce.getException();
              x.printStackTrace();
         catch (TransformerException te)
              System.out.println("\n** Transformation error in add:");
              System.out.println(" " + te.getMessage());
              Throwable x = te;
              if (te.getException() != null)
                   x = te.getException();
              x.printStackTrace();
         catch (SAXException sxe)
              System.out.println("sax exp" + sxe.getMessage());
         catch (Exception ex)
              System.out.println("exc exp" + ex);
              ex.printStackTrace();
    Hope this will help you XML_FILE is constant representing the path of the file. It should be in classpath. The program essentially parsing a xml file and creating dom document and then writing it back to the same file. you can do any modifications/write to other file etc...
    Think this will suffice your requirement
    bye
    take care
    Hi
    I am able to load an XML file into a XML DOM object
    using JAVA (xerces). I have update the required data
    in the DOM.
    But I am NOT able to save back the data to the
    physical file.
    Will appreciate if you can help me ASAP.

  • How to save and retrive table column values added via view enhancement

    Hi,
    I want to enhance standard webdynpro component FITE_VC_REVIEW.
    I want to add new column to Fight Info Table and also to Hotel Info table.I can do UI changes via view enhancement .
    First Approach: I add new fields to Flight Info and Hotel Info structure.
    Create an additional Coolum in Flight Info and Hotel Info Table and Bind it to newly created field in structures.
    Question :
    What all changes I have to make to save and retrieve values from database table.
    Kindly guide with Steps
    Second Approach: I create a new table/structure for my requirement and bind table column to these fields.
    Question:
    What all changes I have to make to save and retrieve values from database table.
    Kindly guide with Steps
    And which approach will be good.
    Regards,
    Madhvika

    no ans yet

  • How to store and retrieve XML messages in AQ using ESB/ BPE

    Hello,
    I am having a requirement which I feel should be fairly common - store and retrieve XML messages in AQ. However, I am struggling to decide which type of queue to use AQ or JMS...Here is the requirement
    1. In an ESB, I want to read different kind of files using file adapter. Different kind as in, having different structure or schema
    2. I want to create a queue that is capable of storing any kind of xml data. To this queue, I want to enqueue the message read in step 1.
    3. In another process, say a BPEL, I want to dequeue the message and write into a file. The filename is retrieved from one of the header properties. I want to dequeue using a stored procedure, not by using a JMS or AQ Adapter (reason being that these adapters poll the queue, and consume a message immediately. However, I want to consume the message only when there is a business need)
    My questions are:
    1. What kind of queue I should create in the DB (What should be its payload type...XMLType? )... I guess the answer would also determine the adapter to be used - JMS or AQ
    2. How I should map the xml data read from the file in step 1 to this adapter
    Any help is highly appreciated.

    You are right in suggesting that I dont need to store my XML data as xml in the DB...I dont want to too :) but its just that, thats the only option I can see at this time (the other track i am exploring is :
    File adapter(XML) -> Convert to opaque (base64binary) -> Enqueue opaque to JMS (aq$_jms_bytes_message) ->Dequeue Opaque -> Write file opaquely.
    In this I have hit the roadblock in trying to convert XML to base64binary...maybe some custom java function is needed...anyway)
    Coming back to this thread, where I am trying the following
    File adapter(XML)  -> Enqueue as XML to queue  ->Dequeue XML -> Write file opaquely.
    PS: I think its important for me to mention that I am using SOA 10.1.3.1.0
    I tried the steps you gave...after creating the queue, I am trying to create a JMS adapter. But the queue I created doesnt show up in the browse window of destinations for the JMS Adapter..That had led me to infer that JMS adapter cant be used
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_row_type AS OBJECT
    (update_queue_id NUMBER
    ,upc VARCHAR2(20)
    ,price1 NUMBER);
    {color}
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_rec_type AS VARRAY(9999999) OF batchupdate_row_type;
    CREATE OR REPLACE TYPE payload_type AS OBJECT ( payload batchupdate_rec_type);
    EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE ( queue_table => 'jmsuser.batch_update_queue_table', queue_payload_type => 'payload_type');
    EXECUTE DBMS_AQADM.CREATE_QUEUE ( queue_name => 'batch_update_queue', queue_table => 'jmsuser.batch_update_queue_table');
    EXECUTE DBMS_AQADM.START_QUEUE ( queue_name => 'batch_update_queue'); {color}
    I also needed some opinion on whether the last step of my proposed solution ( Dequeue XML -> Write file opaquely) is possible. As I want to develop a service oblivious of the structure of the file, I dont want to create a file adapter based on a particular xsd...so I want to write whatever xml I am getting from the queue....is this step possible

  • How to write and read Xml file from database if possible?

    Hi all,
    I need to read the .Xml file when receives from Source systems and write the data into the table as well as write in the.xml file thru reading the data from table as per the client needs. I am stranger to this area. Since, please provide some examples how to approach the same.
    Thanks in advance !!
    Regards.
    Vissu.....

    The XML DB forum is better suited to your question.
    It also has a FAQ which details how to read and shred XML into tables as well as other common XML based questions...
    XML DB FAQ

  • How to set and retrive the index log path stored by parameter LOG_DIRECTORY

    how to set and retrive the index log path stored by parameter LOG_DIRECTORY.

    http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14213/lsnrctl.htm#sthref72
    http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14213/cmctl.htm#sthref239

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • How to save and  move an application

    Hi,
    I have made an application on Oracle Express. How to save and move that to another machine ?
    Many thanks.

    I'm in the process of porting my XE app to a 10.1 instance.
    I created an app export and export file of the schema. Then I installed a client on the same machine so I could connect and I get errors detailed in the end of this thread when attempting to import. Most of the tables are successful however, none of the procedural code goes in. The app export imported fine.
    Now, I can manually copy the objects that remain but only if I can connect to XE and this ability seems to have been lost with the install of the 10.1 client.
    Does anyone know how I can connect to XE using PLSQL Developer or is it indeed possible to connect to XE on a machine that is configured to also connect to a 10.1 remote server? I have installed the 10.1 client into a new Oracle home.
    . importing CODESPEED's objects into PRIMPATH
    IMP-00008: unrecognized statement in the export file:
    IMP-00017: following statement failed with ORACLE error 1950:
    "CREATE TABLE "FOLDER" ("FOLDER_ID" NUMBER NOT NULL ENABLE, "STAFF_ID_CREATE"
    "" NUMBER NOT NULL ENABLE, "STAFF_ID_MODIFY" NUMBER, "FOLDER_NAME" VARCHAR2("
    "100) NOT NULL ENABLE, "FOLDER_CREATED" DATE NOT NULL ENABLE, "FOLDER_MODIFI"
    "ED" DATE NOT NULL ENABLE, "FOLDER_NOTES" CLOB, "FOLDER_OWNER" NUMBER NOT NU"
    "LL ENABLE, "DRA_VERSION_ID" NUMBER, "ASSIGNED" NUMBER NOT NULL ENABLE, ""
    "UNASSIGNED" NUMBER NOT NULL ENABLE, "APPROVED" NUMBER NOT NULL ENABLE, "FOL"
    "DER_STATUS" VARCHAR2(1) NOT NULL ENABLE, "CODING_RULE_SET" NUMBER) PCTFREE"
    " 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FR"
    "EELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" LOGGING NOCOMPRESS "
    "LOB ("FOLDER_NOTES") STORE AS (TABLESPACE "USERS" ENABLE STORAGE IN ROW CH"
    "UNK 8192 PCTVERSION 10 NOCACHE LOGGING STORAGE(INITIAL 65536 FREELISTS 1 F"
    "REELIST GROUPS 1 BUFFER_POOL DEFAULT))"
    IMP-00003: ORACLE error 1950 encountered
    ORA-01950: no privileges on tablespace 'USERS'
    IMP-00017: following statement failed with ORACLE error 2248:
    "ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL = 2 NLS_LENGTH_SEMANTICS = 'BYTE' PL"
    "SQL_CODE_TYPE = 'INTERPRETED' PLSQL_DEBUG = TRUE PLSQL_WARNINGS = 'DISABLE:"
    "ALL'PLSQL_CCFLAGS = ''"
    IMP-00003: ORACLE error 2248 encountered
    ORA-02248: invalid option for ALTER SESSION
    IMP-00000: Import terminated unsuccessfully
    C:\Documents and Settings\PWin>

  • How to save and edit a Word template and excel??

    How to save and edit a Word template and excel (extension. doc and. xls) in an XE database, which can be opened to allow the document and record all changes made by the user of the palicacion.
      or where it a clear tutorial on this topic.?
    I appreciate your attention and collaboration.
    good day ...

    You should not expect to do this in Oracle. But by .net, it can be fine
    http://www.codeproject.com/Articles/36432/Edit-Microsoft-Word-Document-From-Your-Application

  • Built-in SSH Terminal question on how to save and exit

    Howdy, Heres my question and problem.
    I haven't been able to figure out how to save and exit the editor for the SSH terminal that the mac has. I've read that to save you press control -O hit return and to exit hit control -X but that doesn't seem to be working.
    I'm trying to install imagemagick onto my web server and I get stuck at that point of saving and then exiting.
    can anyone tell me how to save and exit the editor?
    I hold down control press -O i let go of the buttons then i press control -X and it stays at the same editor like nothing happened. I try quitting the terminal and reloading it all but that just causes me to restart and nothing saved. and I actually hit the "-" key should i do that or no?
    heres the instructions I'm following for the imagemagick install.
    (For this next part, if you don't have "pico", you can use "vi" instead)
    $ cd libtiff-lzw-compression-kit
    $ pico Makefile
    change
    TIFFSRCDIR = /tmp/libtiff
    to
    TIFFSRCDIR = ../tiff-v3.5.5
    Then save and exit the Editor $ make install
    $ cd ..
    $ cd tiff-v3.5.5
    $ ./configure
    thanks for any help
    -Ahufs

    ctrl+x (thats both keys at the same time) will invoke the exit of the program. at wich point if youve made changes to the file it will ask you if you want to save the data or not. If yes you need to type yes or y and hit enter... if no then no or n. Then it will ask you what you want the file name to be with the default being whatever the file was that you opend to buffer to work on so in most cases you hit enter again.
    hitting ctrl+o (thats both at the same time again) should write the file out and close the application without prompting i think (i dunno for sure... i always use ctrl+x myself).
    At least thats on the OS X version of pico... your server is probably linux so it may differ although i wouldnt expect it to. my pico bindings have always been the same from Debian to CentOS to Darwin.
    Also i msut ask... why cant you pass the TIFFSRCDIR as an option to ./configure like normal instead of manually editing the make file?

  • How to store and retrive images in oracle database

    hi,
    i am interested in storing some students pictures ( photos) into my oracle database, and i want to know since the images are considered as binary data and since BLOB and CBLOB and supported by oracle, how to insert and to select the picture from oracle from my swing-based application?
    does anyone have a complete sample or tutorial doing that well!!
    thx

    Mira este link,
    hay varios articulos interesantes.
    http://www.oracle-base.com/articles/9i/Articles9i.php
    tambien puedes consultar este link
    http://tahiti.oracle.com/pls/db92/db92.homepage
    completa los coampos solicitados con la palabra "Images"
    hay un manual de LOBs muy completo

  • How to save the instance in standard lead from custom business object

    Hi Experts,
              I am unable to save the instance(Record) in standard Lead business object from custom business object.
    Steps:
    created one custom business object with mandatory fields for creating instance in standard lead.
    in quick create screen i bind  data elements to standard lead business object elements.
    issue:
    when i click on preview i am getting exception as Arguments not found
    can you please tell me that How to save the instance in standard lead from custom business object with step by step .

    Hi Vijay,
    Please refer this link under that mentioned that how to create lead using ABSL code
    Web 2 Lead in SAP Cloud for Customer, step by step - Part 1 - myCloudDoor myCloudDoor
    Under the "Action-CreateLead.absl" mentioned how to create lead
    the above link for convert web 2 lead functionality and under they create lead using web data from ABSL code.
    Regards,
    Mithun

  • How to save SOME time machine Mac backups from the TM disk to other disk WITHOUT formatting the destination disk?

    Hi,
    How to save SOME time machine Mac backups from the TM disk to other disk WITHOUT formatting the destination disk?
    I have a Time Machine disk (A) including the backups of several different Macs (B, C, D & E) generated with an old Mac OS X 10.5.8 (iMac PowerPC) over the years.
    I have transferred the old Mac contents to a new Mac with OS X 10.8.3 using Migration Assitant. All OK.
    Now, I want to erase such TM disk A to use if for other purposes, but first, I would like to RECOVER the backups of some Macs inside it (D and E). Is that possible WITHOUT formatting the destination disk and selecting only some Macs from the TM disk and not the fulll TM disk? How?
    Thanks.

    Thanks for the reply. I do not think that is messy, anway. I simply used the same external disk as Time Machine disk for different Macs. And that worked OK all the time for years.
    The ExternalTimeMachineDisk contains the folder Backups.backupdb
    which contains the following folders (each one corresponding to the Time Machine backup made from each Mac):
    Mac1
    Mac2
    MacBook1
    MacBook2
    In relation to my message above, is it possible to select specific files, folders or full Mac backups from such Time Machine disk and save them to other disk? How?
    Thanks.

  • How to compile and run a .java file from another java program

    hello,
    can any one tell me how to compile and run a *.java* file from another java program which is not in same directory?

    Well a smarter way of implementing this is by using a solution provided by Java Itself.
    If you are using J2SE 6.0+ there is an in built solution provided along with JDK itself and inorder to go ahead with solution the below are set of API which you;d be using it for compiling Java Programs (Files)
    http://java.sun.com/javase/6/docs/api/javax/tools/package-summary.html
    How do i do that ??
    Check out the below articles which would help you of how to do that
    http://www.ibm.com/developerworks/java/library/j-jcomp/index.html
    http://www.javabeat.net/javabeat/java6/articles/java_6_0_compiler_api_1.php
    http://books.google.com/books?id=WVbpv8SQpkEC&pg=PA155&lpg=PA155&dq=%22javax+tools%22+compiling+java+file&source=web&ots=XOt0siYe-f&sig=HH27ovuwvJgklIf8omTykUmy-eM
    Now once we are done with compilation.In order to run a Specific class all you ought to do is create an object and its specific methods of a specified class included in the CLASSPATH which you can manage it easily by usage little bit reflections.
    Hope that might help :)
    REGARDS,
    RaHuL

  • How to find and remove obsolete table entries from /SAPAPO/MATKEY table in EWM System.

    Hello,
    How to find and remove obsolete table entries from below tables in EWM System.
    /SAPAPO/MATKEY
    /SAPAPO/MATMAP
    /SAPAPO/MARM
    /SAPAPO/MATLOC
    /SAPAPO/MATMOD
    /SAPAPO/MATRQ
    /SAPAPO/MATLOTSZ
    Thank you,
    Pravin

    Pravin,
    First, tell me how you determine that these entries are 'obsolete'.
    Removing master data from SCM can usually be done using transaction WUF; however, you have to ensure that it is not re-sent to the SCM system, or you are just wasting your time.
    Best Regards,
    DB49

Maybe you are looking for