Store XML data in java cache (hashmap as a key value pair)

Hi,
I have to store a xml file in java cache so that I can resue it .The flow is like this :
DAO layer reads database ,create an xml and sends to --> IBM MQ-->our java code should read this xml file over MQ and store it in a cache (preferably hashmap).The file contain unique id for every customer.
How can we achieve this.One way is to store the xml as an string as key is "id" and value is whole xml.Is this a good way or any other way is available.Please suggest.
Sample xml:
<Client>
<ClientId>1234</ClientId>
<ClientName>STechnology</ClientName>
<ID>10</ID>
<ClientStatus>ACTIVE</ClientStatus>
- <LEAccount>
<ClientLE>678989</ClientLE>
<LEId>56743</LEId>
- <Account>
<AccountNumber>9876543678</AccountNumber>
</Account>
</LEAccount>
- <Service>
<Cindicator>Y2Y</Cindicator>
<PrefCode>980</PrefCode>
<BSCode>876</BSCode>
<MandatoryContent>MSP</MandatoryContent>
</Service>
</Client>
Thanks
Sumit

A HashMap can work, but then still store the customer related data in a bean (and perhaps it will have some child objects as well, if for example the service subelement can repeat). So you get a HashMap of Customer objects, with the clientID as the index into the hashmap.

Similar Messages

  • Java Install,  Cannot insert a key value pair into the secure store fails,

    Dear All,
    I'm doing Java Intallaion in BI7 on CI and in the midle of installtions we encounter,
    TRACE      [iaxxejsexp.cpp:199]
               EJS_Installer::writeTraceToLogBook()
    NWException thrown: nw.secureStore.cannotInsertIntoSecureStore:
    Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    ERROR      2008-04-23 11:36:21
               CJSlibModule::writeError_impl()
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    TRACE      [iaxxejsbas.hpp:460]
               EJS_Base::dispatchFunctionCall()
    JS Callback has thrown unknown exception. Rethrowing.
    ERROR      2008-04-23 11:36:21 [iaxxgenimp.cpp:731]
               showDialog()
    FCO-00011  The step insertAdminDataInSecStore with step key |NW_Addin_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|8|0|NW_CI_Instance_Configure_Java|ind|ind|ind|ind|4|0|insertAdminDataInSecStore was executed with status ERROR .
    TRACE      [iaxxgenimp.cpp:719]
               showDialog()
    There's any want in here can help us Please,
    Thanks and Best Regards,
    Chrisna

    The clean way to Uninstall JAVA is through SAPINST. 
    Make user you drop only the JAVA Schema ID (SAPSR3DB)
    If you want to uninstall manually, follow as mentioned below :
    1. Stop the central services instance and all dialog instances of your SAP system:
    a) Log on to the corresponding instance host as user <sapsid>adm.
    b) Execute the following commands:
       To stop the central services instance:
                 stopsap r3 <SCSinstanceName>
       To stop a dialog instance:
                stopsap r3 <DialogInstanceName>
    2. Stop the J2EE Engine of the central instance:
    a) Log on to your SAP system.
    b) Call transaction SMICM.
    c) Choose Administration J2EE Instance (local) Send Hard Shutdown
    2. Drop the J2EE DB schema (the db schema for this one SAP SID) BE VERY CAREFUL, do not drop the DB schema for another existing system or
    the ABAP schema.
    a. Log on as user ora<dbsid>.
    b. Start sqlplus and connect to the database. Enter:
    sqlplus /nolog
    c. SQLPLUS>connect / as sysdba
    d. Enter the following command to delete the database objects of the database schema:
    SQLPLUS> drop user SAP<SCHEMA_ID>DB cascade;
    e. Enter the following command to get the file name of the corresponding data file in the file system:
    SQLPLUS> select file_name from dba_data_files where \
    tablespace_name = ’PSAP<SCHEMA_ID>DB’;
    f. Enter the following command to delete the tablespace of the database schema:
    SQLPLUS> drop tablespace PSAP<SCHEMA_ID>DB including contents;
    g. Exit sqlplus:
    SQLPLUS> exit
    3. Remove folder "data" at: /sapmnt/QO1/global/security/data
    4. Remove folder "SDM" at: /usr/sap/<sid>/<Central instance>/SDM
    5. Remove folder "j2ee" at:  /usr/sap/<sid>/<Central instance>/j2ee
    6. Revert CI instance profile to their original state (backup copies should exist) # they should be in the state before the start of the JavaAdd In
    7. If lines beginning with the following parameters appear, delete these lines from the default profile, /usr/sap/<SAPSID>/SYS/profile/DEFAULT.PFL:
    j2ee/dbname =
    j2ee/dbtype =
    j2ee/dbhost =
    j2ee/dbadminurl =
    j2ee/scs/host =
    j2ee/scs/system =
    j2ee/ms/port =
    8. If lines beginning with the following parameters appear, delete these lines from the central instance pro?le and from all dialog instance pro?les,
    /usr/sap/<SAPSID>/SYS/profile/<SAPSID>_<INSTANCE_NAME>_<host_name>:
    exe/j2ee =
    exe/jlaunch =
    rdisp/j2ee_start_control =
    rdisp/j2ee_start =
    rdisp/j2ee_timeout =
    rdisp/j2ee_libpath =
    rdisp/frfc_fallback =
    jstartup/trimming_properties =
    jstartup/instance_properties =
    jstartup/protocol =
    jstartup/vm/home =
    jstartup/max_caches =
    jstartup/release =
    j2ee/dbdriver =
    9. Delete the central services instance
    10. Restart ABAP and Install JAVA Add-in
    Edited by: Shaji Jacob on Apr 27, 2008 11:46 AM

  • Store XML data as relational data into Oracle tables using Java and XMLType

    I want to store xml data into an Oracle 11g table as relational storage, not as CLOB or Binary storage. Then I should also be able to query and fetch this data from table into an XML file.
    Any hint on how to write java code using XMLType to achieve this?
    Any help would be appreciated.

    Thanks for the explanation. I still have few confusions. I will try to elaborate my requirement with a simple example...
    I have the following xsd and xml files. "note" would be the table in database and "to", "from", "heading" and "body" would be the columns of note table. "Tove", "Jan", "Reminder" and "Don't forget me this weekend!" would go as data in one row of note table.
    How do I create note table with the xml schema (xsd file)?
    Should the note table be of XMLType or the columns?
    How do I load the XML data into the columns of note table?
    How do I retrieve the row of note table as XML file?
    XML Schema:
    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.xxxxx.com"
    xmlns="http://www.xxxxx.com"
    elementFormDefault="qualified">
    <xs:element name="note">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="to" type="xs:string"/>
          <xs:element name="from" type="xs:string"/>
          <xs:element name="heading" type="xs:string"/>
          <xs:element name="body" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    XML Data:
    <?xml version="1.0"?>
    <note>
      <to>Tove</to>
      <from>Jan</from>
      <heading>Reminder</heading>
      <body>Don't forget me this weekend!</body>
    </note>

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • XML data storage - How to handle symbol ' inside xml data from java code

    Hi
    I'm trying to store XML data in Oracle XML DB 10gR2 both through SQL and JAVA .
    I have a simple test table called xmltable with a primary key and a XMLType column
    My sql is:
    insert into xmltable values ('020', sys.XMLType.CreateXML(
    '<?xml version="1.0"?>
    <Mpeg7 xmlns="urn:mpeg:mpeg7:schema:2001">
    <DescriptionMetadata id="2005">
    <LastUpdate>2006-10-19T12:48:22.null+01:00</LastUpdate>
    <Creator/>
    <CreationTime>2006-10-19T12:48:22.null+01:00</CreationTime>
    <Instrument>
    <Tool>
    <Name>LAS MPEG-7 Services v1.0</Name>
    </Tool>
    </Instrument>
    </DescriptionMetadata>
    <Description xsi:type="urn:ContentEntityType" xmlns:urn="urn:mpeg:mpeg7:schema:2001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <MultimediaContent xsi:type="urn:ImageType">
    <Image id="2005">
    <MediaInformation>
    <MediaProfile>
    <MediaFormat>
    <Content/>
    <Medium href="urn:mpeg:MPEG7MediumCS:2.1.1"/>
    <FileFormat href="urn:mpeg:IPTCMimeTypeCS:image/jpeg"/>
    <FileSize>2782043</FileSize>
    <VisualCoding>
    <Format colorDomain="color" href="urn:mpeg:MPEG7VisualCodingFormatCS:1"/>
    <Frame height="11604" width="8676"/>
    </VisualCoding>
    </MediaFormat>
    </MediaProfile>
    </MediaInformation>
    <MediaLocator>
    <MediaUri>oracle:bosch.informatik.rwth-aachen.de:1521/SMILEY/AMSDB.MEDIA_IMAGE/IMAGE[IMG_ID=2005]</MediaUri>
    </MediaLocator>
    <TextAnnotation>
    <FreeTextAnnotation>B?miy?n and Shikari areas</FreeTextAnnotation>
    </TextAnnotation>
    <Semantic>
    <SemanticBaseRef href="oracle:bosch.informatik.rwth-aachen.de:1521/SMILEY/AMSDB.OBJECT_XML/MPEG7_SB#/mpeg7:Mpeg7/mpeg7:DescriptionMetadata[@id='65']"/>
    <SemanticBaseRef href="oracle:bosch.informatik.rwth-aachen.de:1521/SMILEY/AMSDB.OBJECT_XML/MPEG7_SB#/mpeg7:Mpeg7/mpeg7:DescriptionMetadata[@id='148']"/>
    </Semantic>
    </Image>
    </MultimediaContent>
    </Description>
    </Mpeg7>
    Unfortunately I'm facing problem with the symbol ' at the tags:
    <SemanticBaseRef href="oracle:bosch.informatik.rwth-aachen.de:1521/SMILEY/AMSDB.OBJECT_XML/MPEG7_SB#/mpeg7:Mpeg7/mpeg7:DescriptionMetadata[@id='65']"/>
    <SemanticBaseRef href="oracle:bosch.informatik.rwth-aachen.de:1521/SMILEY/AMSDB.OBJECT_XML/MPEG7_SB#/mpeg7:Mpeg7/mpeg7:DescriptionMetadata[@id='148']"/>
    If I tried with double ' (not '' ) it works with SQL through SQLPLUS but not with java. Indeed I have to store the data through my application
    In java I get java.sql.SQLException: ORA-19102
    Many thanks in advance,
    Evanela

    Thanks for your answer. I downloaded the JDBC AddressBook application and I found it very usefull. I was able to populate a datalist from a datasource and show it in my application. My problem still remains in the sense that I am unable to show the KPI data in a "custom node" meaning I woul like not only to extract directly the database record to a datalist object but also put the information of a single record in a textbok and a gauge and keep control of paging. I think this is done with the parser in the other examples but I can not figure out how to do it with MySQL and the new Desktop screen designer. Should I use a clip object? or is that managed already by the desktop screen designer? or where can I find an example with the functionality I need?.

  • How to store xml data fragments, that will not be queried?

    Hello,
    Delphi Client application communicates with Java Server application via XML messages. Client sends XML message over HTTP Post method. Java Servlet gets XML message, parses it, performs requested action (select/insert/update/delete), generates resulting response and sends it back to the Client.
    I use Oracle DB XE 10.2.
    For example: Client sends a request to the server, to append certain Order with new Product info:
    Request:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Request OrderID="123123123" Action="NewProduct">
    - <Product TempProdID="2" ProdName="L01" VisualID="1" Amount="1" TechClass="1" TechSubject="1" TechVersion="0" TechName="TestTech" ElemOk="0">
    <Modified UserID="XXX" UserGroup="XXX" GroupLevel="0" />
    - <QuickInfo>
    <ProdIcon Format="PNG"
    Encoding="Base64">iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAA
    lC+aJAAAAA3RSTlP////6yOLMAAAAvElEQVR42u3aQQ6EIAwAQP7/afe0
    mo1mBVur0emJgwGmRDFNWwvH9I153OpjyoisefqXW3afm4WypP+MgomvT
    z8AAAAAAAAAAAAAAMAzAClzAWQAdvexfqATEKmA/Fm0rYs5ozvoAWyWj4
    ZqJ9efQKR8BJAHOPEdKAAc/lLdAhC/K68EBG+JWwAixfABgF8Jf6MAAAA
    AAAAAAAAAAAAALwRUGgAAAAAAsgGJ3cfVrcfFl2jiIZzV+V7Zd/8BOtNi
    0MnJ58oAAAAASUVORK5CYII=
    </ProdIcon>
    <Parameters />
    </QuickInfo>
    - <TechProduct CurVer="1" MinVer="1" TotalItems="330" ItemNodeSize="55074">
    - <SubItem Class="TPlGraph" BindID="00B9C004">
    <PropList />
    - <SubItem Ident="Profiles" Class="TProfileList" Child="1" BindID="0188598C">
    <PropList />
    - <SubItem Class="TPlProfile" Child="1" BindID="018CA6CC">
    - <PropList>
    <Property PropIdent="ProfBaze0X" ValText="0" />
    <Property PropIdent="ProfBaze0Y" ValText="990" />
    <Property PropIdent="ProfBaze1X" ValText="990" />
    <Property PropIdent="ProfHier0" ValText="0" />
    - <Property PropIdent="InBorder" ValIdent="None" ValText="N&#279;ra">
    <ExtValue ColIdent="ItemCode" Value="None" />
    <ExtValue ColIdent="Type" Value="" />
    <ExtValue ColIdent="Filter" Value="" />
    <ExtValue ColIdent="Width" Value="0" />
    <ExtValue ColIdent="TechCall" Value="" />
    </Property>
    </PropList>
    </SubItem>
    </SubItem>
    </SubItem>
    </TechProduct>
    </Product>
    </Request>
    I use DOM parsers to parse the received requests, extract certain info and insert it into relational tables using standart SQL queries.
    My question is: what is the best way to store XML data fragments, that are not required to be saved relationally? I need to save the content of node <TechProduct> from the above example to relational table's column. There will be no need to query this column, no need to use relational views. I will use it only when Client application will request to modify certain order's product. Then I will have to send back the same <TechProduct> node via XML response.
    So what column type do I have to use? CLOB? XMLType? Is it better to use object types? Do I have to register XML Schema for better performance? The size of the fragment can be ~2MB.
    Thanks for your help
    Message was edited by:
    Kichas

    Thank you for reply,
    As you suggested, I will use XMLType storage as CLOB (without XML Schema).
    As I mentioned before, I use Java Servlet, deployed on Tomcat WebServer, to receive XML messages from Client application via HTTP POST method.
    I use these libs to get the XML payload and parse it into a Document:
    import org.w3c.dom.*;
    import org.xml.sax.InputSource;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    And here is the code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try {
    // get the XML payload and parse it into a Document
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document dom;
    InputSource input = new InputSource(request.getInputStream());
    dom = docBuilder.parse(input);
    catch(Exception ex) {
    System.out.println("Exception thrown in XmlService");
    ex.printStackTrace();
    throw new ServletException(ex);
    I create a relational table, that contains XMLType column:
    CREATE TABLE xwarehouses (
    warehouse_id NUMBER,
    warehouse_spec XMLTYPE)
    XMLTYPE warehouse_spec STORE AS CLOB;
    Now I want to insert all DOM Document into XMLType column. So I do like this:
    import oracle.xdb.XMLType;
    String SQLTEXT = "INSERT INTO XWAREHOUSES (WAREHOUSE_ID, WAREHOUSE_SPEC) VALUES (?, ?)";
    XMLType xml = XMLType.createXML(con,dom);
    PreparedStatement sqlStatement = con.prepareStatement(SQLTEXT);
    sqlStatement.setInt(1,2);
    sqlStatement.setObject(2,xml);
    sqlStatement.execute();
    sqlStatement.close();
    dom is the Document, that I got from HTTP Request input stream.
    My servlet throws an exception:
    java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
    at XmlService.GetMatListServiceHandler.processRequest(GetMatListServiceHandler.java:111)
    at XmlService.XmlServiceHandler.handleRequest(XmlServiceHandler.java:43)
    at XmlService.XmlServiceServlet.doPost(XmlServiceServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
    why does he needs oracle.xml.parser.v2.XMLParseException? I don't use Oracle parser? Does this code line throws the exception (I am not able to debug my code, because I have not configured JDeveloper to be able to use Remote Debuging):
    XMLType xml = XMLType.createXML(con,dom);
    Does it reparses the given dom Document or what?. When I deploy xmlparserv2.jar to Tomcat, everything is ok, application inserts XML data into XMLType column.
    Is there another way to insert the whole org.w3c.dom Document or Document fragment (that is already parsed) into XMLType column. Can you provide any sample code?
    The Document may contain national symbols, so they should be correctly stored and then later retrieved.
    Many thanks.

  • How to store XML data into Oracle Table

    I had trouble to store XML data into Oracle Table with XDK (Oracle 8.1.7 ). The error is:
    C:\XDK_Java_9_2\xdk\demo\java\Test>java testInsert Dept.xml
    <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element expected.
    Exception in thread "main" oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2263)
    at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1333)
    at testInsert.main(testInsert.java:8)
    Here is my xml file:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>10</DEPTNO>
    <DNAME>ACCOUNTING</DNAME>
    <LOC>NEW YORK</LOC>
    </ROW>
    <ROW num="2">
    <DEPTNO>20</DEPTNO>
    <DNAME>RESEARCH</DNAME>
    <LOC>DALLAS</LOC>
    </ROW>
    <ROW num="3">
    <DEPTNO>30</DEPTNO>
    <DNAME>SALES</DNAME>
    <LOC>CHICAGO</LOC>
    </ROW>
    <ROW num="4">
    <DEPTNO>40</DEPTNO>
    <DNAME>OPERATIONS</DNAME>
    <LOC>BOSTON</LOC>
    </ROW>
    </ROWSET>
    and here is structure of table:
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    and here is my Java Code:
    import java.sql.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert{
         public static void main(String[] args) throws SQLException{
              Connection conn = getConnection();
              OracleXMLSave sav = new OracleXMLSave(conn,"scott.tmp_dept");
              sav.insertXML(args[0]);
              sav.close();
              conn.close();
         private static Connection getConnection()throws SQLException{
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@amt-ebdev01:1521:mydept","scott","tiger");
              return conn;
    Could you help me ? Thanks !

    The problem is that you need to pass avalid URL , Document...
    Please try this code instead:
    import java.net.*;
    import java.sql.*;
    import java.io.*;
    import oracle.xml.sql.dml.OracleXMLSave;
    public class testInsert
    public static void main(String[] args) throws SQLException{
    Connection conn = getConnection();
    OracleXMLSave sav = new OracleXMLSave(conn,"scott.temp_dept");
    URL url = createURL(args[0]);
    sav.insertXML(url);
    sav.close();
    conn.close();
    private static Connection getConnection()throws SQLException{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@dlsun1982:1521:jwxdk9i","scott","tiger");
    return conn;
    // Helper method to create a URL from a file name
    static URL createURL(String fileName)
    URL url = null;
    try
    url = new URL(fileName);
    catch (MalformedURLException ex)
    File f = new File(fileName);
    try
    String path = f.getAbsolutePath();
    // This is a bunch of weird code that is required to
    // make a valid URL on the Windows platform, due
    // to inconsistencies in what getAbsolutePath returns.
    String fs = System.getProperty("file.separator");
    if (fs.length() == 1)
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    url = new URL(path);
    catch (MalformedURLException e)
    System.out.println("Cannot create url for: " + fileName);
    System.exit(0);
    return url;

  • Write / store xml data in Xe and retrieve stored data using pl/sql

    Hi to all,
    i'm searching a tutorial on:
    A - how to write / store xml data in Xe and retrieve stored data using pl/sql
    I don't want to use other technologies, because i use htmldb and my best practice is with pl/sql.
    I was reading an ebook (quite old maybe) however it's about oracle 9 and it's talking about xmltype:
    1 - I don't understand if this is a user type (clob/varchar) or it's integrated in Oracle 9 however i will read it (it's chapter 3 titled Using Oracle xmldb).
    Please dont'reply here: i would be glad if someone can suggest me a good tutorial / pdf to achieve task A in Oracle XE.
    Thanx

    Thank you very much Carl,
    However my fault is that i've not tried to create the table via sql plus.
    Infact i was wrong thinking that oracle sql developer allows me to create an xmltype column via the create table tool.
    however with a ddl script like the following the table was created successfully.
    create table example1
    keyvalue varchar2(10) primary key,
    xmlcolumn xmltype
    Thank you very much for your link.
    Message was edited by:
    Marcello Nocito

  • How can we store xml data using jsp

    hai,
    Can anyone please explain in brief how to store xml data using jsp. Also if possible please explain by specifying the code.
    regards,
    Praveen Vinnakota.

    [email protected] wrote:
    how can we publish Labview data using the web?
    You could use shared variables and publish them to the network or use data sockets.
    Kudos always welcome for helpful posts

  • A key/value pair with this key already exists in the store

    Hi all,
    In the installation of PI components on the AS ABAP+ AS JAVA with finalization of the Java Addin the iam facing this problem :
    In short it mentioning that the " A key/value pair with this key already exists in the store.", Please see below for more information....:
    CJSlibModule::writeWarning_impl()
    Execution of the command "/opt/java1.4/bin/java -classpath
    /oracle/stage/PIDtemp/sapinst_instdir/NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/sharedli
    b/launcher.jar -Xmx256m -d64 com.sap.engine.offline.OfflineToolStart
    com.sap.security.core.server.secstorefs.SecStoreFS
    /usr/sap/PID/SYS/global/security/lib/tools/iaik_jce.jar:/usr/sap/PID/SYS/global/security/lib
    /tools/iaik_jsse.jar:/usr/sap/PID/SYS/global/security/lib/tools/iaik_smime.jar:/usr/sap/PID/
    SYS/global/security/lib/tools/iaik_ssl.jar:/usr/sap/PID/SYS/global/security/lib/tools/w3c_ht
    tp.jar:/oracle/stage/PIDtemp/sapinst_instdir/NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/l
    ib:/oracle/stage/PIDtemp/sapinst_instdir/NW04S/LM/AS-JAVA/ADDIN/ORA/CENTRAL/CI/install/share
    dlib:/oracle/client/10x_64/instantclient/ojdbc14.jar insert -s PID -f
    /usr/sap/PID/SYS/global/security/data/SecStore.properties -k
    /usr/sap/PID/SYS/global/security/data/SecStore.key admin/host/PID tern" finished with return
    code 2. Output:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store.
    ERROR      2007-02-15 18:35:29
               CJSlibModule::writeError_impl()
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log
    file SecureStoreInsert.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    A key/value pair with this key already exists in the store..
    ERROR      2007-02-15 18:35:29 [iaxxgenimp.cpp:731]
               showDialog()
    FCO-00011  The step insertAdminDataInSecStore with step key
    |NW_Addin_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|8|0|NW_CI_Instance_Configure
    _Java|ind|ind|ind|ind|4|0|insertAdminDataInSecStore was executed with status ERROR

    Hi Kamalakar
    I think this problem happens due to wrong content of SDMKIT.JAR - incorrect crypto SDA is deployed.I dont know the installation procedure you followed because normally this error wont come.
    I would rather suggest a work around seeing your problem
    <b>Edit the keydb.xml exchanging [ERROR] with [OK]</b>
    Follow the above step and restart your installation.
    Do not forget to reward points:

  • Can we achieve data conversion for my scenario key value pair

    My data 
    create table test
    ( id int,name varchar(10),value int, color varchar(20))
    I would like to have data in the following format 
    where each id will combination of data set for each row for a id and separated by delimiter from another set
    like a key value pair
    ID Value
    1 |a,10,green|a,15,blue|
    2 |b,11,red|b,12,yellow|
    Please let me know if this can be achived in SSIS using trasnformation or in SQL ?
    And if so what is the best approach to hande this conversion
    Mudassar

    Thanks for your help.
    I can assume that it can only be handled in SQL and this cant be done in SSIS transformations.
    EXAMPLE 4 - Using XML PATH & correlated subquery for sublist
    -- Create comma delimited sublist
    SELECT   Subcategory = ps.[Name],
             ColorList = Stuff((SELECT DISTINCT  ',
    ' + Color AS [text()]
                                FROM AdventureWorks2008.Production.Product
    p
                                WHERE p.ProductSubcategoryID = ps.ProductSubcategoryID
                                FOR XML PATH ('')),1,1,'')
    FROM     AdventureWorks2008.Production.ProductSubcategory
    ps
    ORDER BY Subcategory;
    GO
    Subcategory             ColorList
    Helmets                 Black, Blue, Red
    Hydration Packs         Silver
    Jerseys                 Multi, Yellow
    Mudassar

  • Cannot insert a key value pair into the secure store fails; see output of l

    Hi,
    how can I fix this problem ?
    SAPNW2004sJavaSP9_Trial\SAP_NetWeaver_2004s_SR_1
    jdkversion 142_09 .
    ERROR 2008-07-10 13:13:31
    CJS-30051  Cannot insert a key value pair into the secure store fails; see output of log file SecureStoreInsert.log: SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    Regds
    sas

    Hi Arzu,
    thank you for your replying.
    The current OS I am using is Microsoft Windows XP
    Service Pack 2.
    The very last installation was made with JDK version 142_12.
    However it was pointless. I can try to reinstall with
    the mentioned newest JCE policy files .
    Can tell me from where I can obtain these above
    JCE policy files ?
    Regards
    Erdem Sas

  • CRM7 EH1 ICI/CTI: Add Key-Value Pair to Call Attached Data

    We are CRM 7 EHP1 integrated to Genesys CTI (Communication Mangement Software) through ICI.
    Is it possible in web_ui to add a Key-Value Pair (kvp) to the Call Attached Data (CAD) that it is sent back to the CMS?
    For example: When an agent clicks Transfer to transfer a call to a queue, just prior to the transfer we would like to add a new kvp to the CAD that is sent back to Genesys via ICI.
    Any advice on how to do this is appreciated.

    Hi shiva
    Thanks for your help,
    Can you check this coding and revert me back ASAP Please.
    REPORT BDS_GOS_CONNECTION.
    DATA : logical_system LIKE BAPIBDS01-log_system.
           CLASSNAME LIKE BAPIBDS01-CLASSNAME
           OBJKEY LIKE SWOTOBJID-objkey.
    PARAMETERS: pa_lo_sys BAPIBDS01-log_system,
                pa_class like BPIBDS01-CLASSNAME,
                pa_objkey like swotobjidobjkey.
    AT SELECTION-SCREEN.
    CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
             EXPORTING
                  bor_id             = bor_id
             IMPORTING
                  logical_sytem      = pa_lo_sys.
                  classname          = pa_class.
                  objkey            = pa_objkey.
             EXCEPTIONS
                  no_objects_found     = 1
                  internal_error       = 2
                  internal_gos_error   = 3.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
    clear v_attno1.
    i_object1-typeid = 'BUS2012'.
    i_object1-catid  = 'BO'.
    i_object1-instid = i_yItem-docno.
    call method cl_gos_attachment_query=>count_for_object
       exporting
        is_object = i_object1
        ip_arl    = space
       receiving
        rt_stat   = i_stat1.
    read table i_stat1 into wa_stat1 index 1.
    if sy-subrc eq c_0.
        move wa_stat1-counter to v_attno1.
    endif.             
    CALL METHOD cl_gos_attachment_query=>count_for_object
    EXPORTING
    is_object = object
    ip_arl =    space
    RECEIVING
    rt_stat = lt_stat.
    READ TABLE lt_stat INDEX 1 into ls_stat.
    count = ls_stat-counter.
    *The object has to be a concatenation of your document, like this:
    CONCATENATE object-instid tab-gjahr INTO object-instid.
    ELSE.
    CONCATENATE tab-bukrs tab-belnr tab-gjahr INTO
    object-instid.
    ENDIF.

  • How to parse xml data into java component

    hi
    everybody.
    i am new with XML, and i am trying to parse xml data into a java application.
    can anybody guide me how to do it.
    the following is my file.
    //MyLogin.java
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    class MyLogin extends JFrame implements ActionListener
         JFrame loginframe;
         JLabel labelname;
         JLabel labelpassword;
         JTextField textname;
         JPasswordField textpassword;
         JButton okbutton;
         String name = "";
         FileOutputStream out;
         PrintStream p;
         Date date;
         GregorianCalendar gcal;
         GridBagLayout gl;
         GridBagConstraints gbc;
         public MyLogin()
              loginframe = new JFrame("Login");
              gl = new GridBagLayout();
              gbc = new GridBagConstraints();
              labelname = new JLabel("User");
              labelpassword = new JLabel("Password");
              textname = new JTextField("",9);
              textpassword = new JPasswordField(5);
              okbutton = new JButton("OK");
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 1;
              gbc.gridy = 5;
              gl.setConstraints(labelname,gbc);
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 2;
              gbc.gridy = 5;
              gl.setConstraints(textname,gbc);
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 1;
              gbc.gridy = 10;
              gl.setConstraints(labelpassword,gbc);
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 2;
              gbc.gridy = 10;
              gl.setConstraints(textpassword,gbc);
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 1;
              gbc.gridy = 15;
              gl.setConstraints(okbutton,gbc);
              Container contentpane = getContentPane();
              loginframe.setContentPane(contentpane);
              contentpane.setLayout(gl);
              contentpane.add(labelname);
              contentpane.add(labelpassword);
              contentpane.add(textname);
              contentpane.add(textpassword);
              contentpane.add(okbutton);
              okbutton.addActionListener(this);
              loginframe.setSize(300,300);
              loginframe.setVisible(true);
         public static void main(String a[])
              new MyLogin();
         public void reset()
              textname.setText("");
              textpassword.setText("");
         public void run()
              try
                   String text = textname.getText();
                   String blank="";
                   if(text.equals(blank))
                      System.out.println("First Enter a UserName");
                   else
                        if(text != blank)
                             date = new Date();
                             gcal = new GregorianCalendar();
                             gcal.setTime(date);
                             out = new FileOutputStream("log.txt",true);
                             p = new PrintStream( out );
                             name = textname.getText();
                             String entry = "UserName:- " + name + " Logged in:- " + gcal.get(Calendar.HOUR) + ":" + gcal.get(Calendar.MINUTE) + " Date:- " + gcal.get(Calendar.DATE) + "/" + gcal.get(Calendar.MONTH) + "/" + gcal.get(Calendar.YEAR);
                             p.println(entry);
                             System.out.println("Record Saved");
                             reset();
                             p.close();
              catch (IOException e)
                   System.err.println("Error writing to file");
         public void actionPerformed(ActionEvent ae)
              String str = ae.getActionCommand();
              if(str.equals("OK"))
                   run();
                   //loginframe.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    }

    hi, thanks for ur reply.
    i visited that url, i was able to know much about xml.
    so now my requirement is DOM.
    but i dont know how to code in my existing file.
    means i want to know what to link all my textfield to xml file.
    can u please help me out. i am confused.
    waiting for ur reply

  • What to use to store binary data in Java

    Hello,
    I have to read data stored as varbinary in the SQL database. What kind of class, data type I can use to store binary data from database?
    I need to store binary data finally in ByteBuffer.
    Please, help.
    Thank you!

    Unfortunately, when I am doing following I am getting an exception:
    ByteBuffer lUTF8BIN=ByteBuffer.allocate(6)
    byte [] lTempByteArray lTempByteArray = Recordset.getBytes(VarBinColumn);
    if (lUTF8BIN.remaining()>=lTempByteArray.length)
    lUTF8BIN.put(lTempByteArray);
    Exception is java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported data conversion

Maybe you are looking for

  • Plant name missing in PO line item details (Delivery address tab)

    Hi We are facing issue with ECC PO migration to SRM SUS client due to missing line item delivery address field name. We have PI integration. Name exist in PO XML on ECC interface but not copied on to PO line delivery address details (ME23n) Impact: W

  • Download a request in text format

    Hi, I want to download a request in readable text format. How do I go about it? If I download the data file, it opens in non-readable binary format. Saba.

  • =?iso-8859-1?Q?I:_Fort=E9_CGI_problem?=

    Messaggio a più sezioni in formato MIME. ------=_NextPart_000_00A9_01BEFB9D.13EFC330 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable *------------------------------------------------------------------------=

  • Is Quickoffice part of the firmware?. Format, *#73...

    couldn`t find much with the search feature so i`ll ask directly here: i have N73 phone, when i open application manager the only installed apps shown are mobilesearch (lots of components), settingwizzard and f-secure antivirus, these were there as i

  • InDesign crashes when inserting new page(s)

    I have a landscape document with facing pages. The origin was an Indd CS3 document opend with CS 5 and saved. I can move pages from one location to another but the attemt to insert one or two new pages will cause indd to crash. This is not a general