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

Similar Messages

  • How can i store the data from the list to MS-Access?

    Hi all,
    We all know that from alv it is possible to export data to Ms-excel or word or text file. Can anyone tell me how can i store the data from alv or reports to Ms-Access?
    Thanks in Advance,
    Abhijit

    Hi,
    If you want that without code, i suppose there is a option in MS-Access to import data from Excel, so you have to first export to excel and then import to Access.
    If you want to code it yourself then have a look at FM TABLE_EXPORT_TO_MSACCESS, as said in Exporting Data from R/3 to MS ACCESS
    You can also see the search results in SCN for [export data to MS-Access (45 Results)|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=exportdatato+MS-Access&cat=sdn_all].
    Regards
    Karthik D

  • How can I validate a date using sql

    How can I validate a date using sql or pl/sql
    select to_date('01/01/2009','mm/dd/yyyy') from dual this is a good date
    but how can I check for a bad date
    select to_date('0a/01/2009','mm/dd/yyyy') from dual
    Howard

    William Robertson wrote:
    It'll be complicated in pure SQL, as you'll have to parse out day, month and year and then validate the day against the month and year bearing in mind the rules for leap years. It would be simpler to write a PL/SQL function and call that.Nah, not that complicated, you just need to generate a calender to validate against.
    SQL> ed
    Wrote file afiedt.buf
      1  with yrs as (select rownum-1 as yr from dual connect by rownum <= 100)
      2      ,mnth as (select rownum as mn, case when rownum in (4,6,9,11) then 30
      3                            when rownum = 2 then 28
      4                       else 31
      5                       end as dy
      6                from dual
      7                connect by rownum <= 12)
      8      ,cent as (select (rownum-1) as cen from dual connect by rownum <= 21)
      9      ,cal as (select cen, yr, mn,
    10                      case when ((yr = 0 and mod(cen,400) = 0)
    11                             or (mod(yr,4) = 0 and yr > 0))
    12                            and mn = 2 then dy+1
    13                      else dy
    14                      end as dy
    15               from cent, yrs, mnth)
    16  --
    17      ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    18  --
    19  select case when cal.cen is null then 'Invalid Date'
    20              when not regexp_like(dt,'^[0-9]{1,2}[\/.-_][0-9]{1,2}[\/.-_][0-9]{4}$') then 'Invalid Date'
    21         else dt
    22         end as dt
    23  from dt left outer join
    24               cal on (to_number(regexp_substr(dt,'[0-9]+')) between 1 and cal.dy
    25                   and to_number(regexp_substr(dt,'[0-9]+',1,2)) = cal.mn
    26                   and floor(to_number(regexp_substr(dt,'[0-9]+',1,3))/100) = cal.cen
    27*                  and to_number(substr(regexp_substr(dt,'[0-9]+',1,3),-2)) = cal.yr)
    SQL> /
    Enter value for date_dd_mm_yyyy: a1/02/2008
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select 'a1/02/2008' as dt from dual)
    DT
    Invalid Date
    SQL> /
    Enter value for date_dd_mm_yyyy: 01/02/2008
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select '01/02/2008' as dt from dual)
    DT
    01/02/2008
    SQL> /
    Enter value for date_dd_mm_yyyy: 29/02/2008
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select '29/02/2008' as dt from dual)
    DT
    29/02/2008
    SQL> /
    Enter value for date_dd_mm_yyyy: 30/02/2008
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select '30/02/2008' as dt from dual)
    DT
    Invalid Date
    SQL> /
    Enter value for date_dd_mm_yyyy: 29/02/2009
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select '29/02/2009' as dt from dual)
    DT
    Invalid Date
    SQL> /
    Enter value for date_dd_mm_yyyy: 28/02/2009
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select '28/02/2009' as dt from dual)
    DT
    28/02/2009
    SQL> /
    Enter value for date_dd_mm_yyyy: 0a/01/2009
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select '0a/01/2009' as dt from dual)
    DT
    Invalid Date
    SQL> /
    Enter value for date_dd_mm_yyyy: 00/01/2009
    old  17:     ,dt as (select '&date_dd_mm_yyyy' as dt from dual)
    new  17:     ,dt as (select '00/01/2009' as dt from dual)
    DT
    Invalid Date
    SQL>

  • How can we publish Labview data using the web

    how can we publish Labview data using the web?
    Dr. Eugene Berman, Moran Kamilyan and Ravit Bar

    [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

  • How to send te XML data using HTTPS post call & receiving response in ML

    ur present design does the HTTP post for XML data using PL/SQL stored procedure call to a Java program embedded in Oracle database as Oracle Java Stored procedure. The limitation with this is that we are able to do HTTP post; but with HTTPS post; we are not able to achieve because of certificates are not installed on Oracle database.
    we fiond that the certificates need to be installed on Oracle apps server; not on database server. As we have to go ultimately with HTTPS post in Production environment; we are planning to shift this part of program(sending XML through HTTPS post call & receiving response in middle layer-Apps server in this case).
    how i can do this plz give some solution

    If you can make the source app to an HTTP Post to the Oracle XML DB repository, and POST contains a schema based XML document you can use a trigger on the default table to validate the XML that is posted. The return message would need to be managed using a database trigger. You could raise an HTTP error which the source App would trap....

  • Using Labview how can one store different data in different sheets of same excel file, I mean how to select different sheets to store data??

    Hello Everyone,
    I want to store various data but in different sheets of excel file. So how to select Different sheets of same excel file???
    Thanks so much 
    Pallavi 

    aeastet wrote:
    Why do you not want to use Active X?
    One very good reason that I can think of is that MS keeps changing their ActiveX interface with each version of Excel, so code written for one version of Excel using ActiveX may not work for another version of Excel, even though the basic functionality hasn't changed. A perfect example is when MS changed the "Value" property to "Value2". Yeah, that made a whole lot of sense.
    pals wrote:
    I dont want to use active X as i am not
    getting results... by using write to spreadsheet in am getting results
    but on just one sheet... I want different data on different sheets of
    same excel file. So....
    Can anyone help me in this...
    Then it's something you're doing. Please post your code. Have you tried a search on this forum for ActiveX and Excel? There have been tons of posts on it, including lots of examples. There's also the Excel thread.

  • How can i get xml data from html

    Hi
    i need to submit data from an html form to server via xml.
    ( ie data shold be in xml format instead of POST/GET methods )
    how can i can i make this happen ?
    Renjith.

    read the excellent suggestion from mochamaniac (reply 2 of 5): http://forum.java.sun.com/thread.jsp?forum=34&thread=303120
    ps. next time run a search on the forum prior from posting ;-)

  • How can I get xml data from KM?

    Hi guys,
    how can i get a xml data from KM?
    I saved an xml document in KM, and I want to read its content. How can I get this document?
    Using
    DocResource = (IResource) resFactory.getResource(RID.getRID("Document/ Path"),resContext)?
    I want to know which kinds of API of KM are responsible for this.
    Thanks in advance
    Regards,
    Liying

    Hi Liying
    use this code.
    try {
                   IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
                   IUser sapUser = wdClientUser.getSAPUser();
                   com.sapportals.portal.security.usermanagement.IUser ep5User =
                        WPUMFactory.getUserFactory().getEP5User(sapUser);
                   IResourceContext resourseContext = new ResourceContext(ep5User);
                   IResourceFactory resourseFactory = ResourceFactory.getInstance();
                   RID pathRID =
                        RID.getRID(
                             "/documents/"(Path to folder where ur file is"");
                   ICollection collection =
                        (ICollection) resourseFactory.getResource(
                             pathRID,
                             resourseContext);
                   IResourceList resourceList = collection.getChildren();
                   IResourceListIterator resourceListIterator =
                        resourceList.listIterator();
    while (resourceListIterator.hasNext()) {
                        com.sapportals.wcm.repository.IResource resource =
                             resourceListIterator.next();
    try {
                             /*File from KM Reading*/
                             InputStream in = resource.getUnfilteredContent().getInputStream();
                             ByteArrayOutputStream out = new ByteArrayOutputStream();
                             byte[] buffer = new byte[4096];
                             int bytesread = 0;
                             while ((bytesread = in.read(buffer)) != -1) {
                                  out.write(buffer, 0, bytesread);
                             String dataToBeConvertedToXML = out.toString();
    catch(Exception e){}
    catch(Exception e){}
    Award points if found usefull.
    I suppose you have used KM sharing reference in ur application
    Regards
    BP

  • How can i display blob (picture) using jsp

    i can get byte array from oracle database.
    and how can i use byte array to display just like img src = '' in html ?
    thankyou

    You can't. You have to use <img src...> in the HTML. That src can be to a servlet that gets the image data from the DB and writes the image data out, of course. Just set the content type to image/jpeg or image/gif or whatever it is.

  • How can I embed XML data in a PDF?

    I want to embed XML data in a PDF so the file can be scanned for the data behind the document. Is there a standard way to do this?
    For example, if the PDF is a bank statement, the embedded XML would be the individual's account number and bank balances. It would not include any of the standard text in the statement such as the bank name, etc.
    I've read up on the XMP spec but that seems to be more metadata about the document (title, subject, etc.). And there is tagged content but that is an alternate view of the entire document.
    ??? - thanks - dave

    Although the XMP block is stored in XML, you can't just embed any XML file. The block has to follow the standard, which means that each data packet needs to be defined in a schema - as the name suggests, XMP is eXtendable so you can define new schema for local use, but you can't mess about with the standard ones and randomly add new tags. The schema itself isn't embedded in the file, it's referenced by a unique ID and URI. of course having a data packet in a custom schema doesn't mean any software will see it - Acrobat's Advanced Search can be told to scan the XMP block but  search engines only tend to bother with the basic tags such as 'title' and 'description'.
    To see what's currently in a PDF, open Document Properties > Description > Additional Metadata > Advanced.
    You can save the current XMP block as a text file (.xmp extension), and replace/append other XMP files. If you click the "i" icon on the top right of the Advanced dialog you can access system profiles - these can be created in other applications such as Bridge, but there's no profile manager in Acrobat itself.
    For technical information on working with XMP and creating new schema, see http://www.adobe.com/devnet/xmp.html
    Note that the XMP SDK for CS6 does not work in the Acrobat Family.

  • How can I access worksheet data in JSP

    I have gone through documentation given on the oracle site and found that worksheet can b exported to html or excel file, but my requirement is that I have to display the content of the worksheet to the client in a JSP page.
    How can I do that????????

    You will need to define an XML typed Transaction input property for processing the message synchronously.  Then in the processing rule for this message you need to associate the proper transaction and map the parameter.
    So essentially the transaction and input parameter mapping in your message services processing rule replaces the category setup that you already have working.

  • How can I upload an image using JSP in database(MySQL)

    I have to develop an application in which users can register themselve by filling up thier information(name, address) etc along with their photo.
    Storing nam etc. is simple but i am unable to upload photo using JSP.

    Here are lot of examples: http://www.google.com/search?q=jsp+file+upload
    Or if you actually have implemented something which doesn't work as expected, then please ask specific questions.

  • How  can i Store a file using in a servlet?

    This is because i have a Applet<->Servlet comunication.....
    With the following application i can store a image in a file in the directory that i indicate.....
    class rec_image
    public static void main(String h[]) {
    Connection con = null;
    Clob cl;
    JPanel photo;
    FileOutputStream file = null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@112.21.2.233:1521:db_name","user","password");
    con.setAutoCommit(false);
    String query = "Select Pict from Pictures where ID_Pict = '180'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    if ( rs.next() ) {
    //Get the GIF
    byte[] bytes = rs.getBytes(1);
    file = null;
    file = new FileOutputStream ("leslie.gif");
    file.write(bytes);
    if (file != null)
    file.close();
    } catch (IOException e) {
    String err = e.toString();
    System.out.println(err);
    } catch (Exception e) {
    String err = e.toString();
    System.out.println(err);
    } finally {
    //if (file != null)
    Now...i need to do the same...but....using a servlet that is called by a applet....but this is not functioning :( ,ie, no file is stored in the directory that i indicate....
    The servlet would recive the query from the applet and the servlet would store the image file in the directory that i indicate....but it is not working correctly...something is wrong.......
    I not obtain any exception ...is like the servlet wasn't executed.....
    I think it...because i dont obtain the System.out.println coments (that i put in the servlet code) in the console and any file is stored :(.....
    Somebody could help me please?
    This is a snnipet of applet code.....
    class store_pict extend JApplet {
    //Some intructions
    private void Store_Picture() {
    try {
    servletURL_bytes = new URL("http://112.21.2.233/servlet/coreservlets.obt_bytes");
    } catch(MalformedURLException e) {
    System.out.println("1er. Error en el m�todo Init() en la construcci�n de la URL");
    System.out.println(e);
    } catch(Exception e) {
    System.out.println("2do. Error en el m�todo Init() en la construcci�n de la URL");
    System.out.println(e);
    String query = "Select Pict from Pictures where ID_Pict = '180'";
    make_servlet_connection_bytes(query);
    private void make_servlet_connection_bytes(String query) {
    System.out.println("Start applet-servlet to store picture");
    ObjectOutputStream outToServlet = null;
    byte [] query_Array_bytes = null;
    try {    
    //Setup servlet connection
    URLConnection servletConnection = servletURL_bytes.openConnection();
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true); // to allow us to write to the URL
    servletConnection.setUseCaches(false); // to ensure that we do contact
    servletConnection.setDefaultUseCaches(false);
    //Send output to servlet
    servletConnection.setRequestProperty("Content-Type", "application/octet-stream");
    outToServlet = new ObjectOutputStream(servletConnection.getOutputStream());
    outToServlet.writeObject(query);
    outToServlet.flush();
    outToServlet.close();
    } catch (Exception e){
    System.out.println("Error en el m�todo make_servlet_connection()");
    e.printStackTrace();
    System.out.println("End applet-servlet to store picture");
    This is my servlet code:
    package coreservlets;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class obt_bytes extends HttpServlet {
    Connection con = null;
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    //aren't sending a get
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    System.out.println("Start Servlet");
    ObjectInputStream inFromApplet = null;
    ObjectOutputStream outToApplet = null;
    String inString = null;
    FileOutputStream file = null;
    try {
    System.out.println("Start Servlet");
         //Read string from applet
         inFromApplet = new ObjectInputStream(req.getInputStream());
         inString = (String) inFromApplet.readObject();
         inFromApplet.close();
    System.out.println("Read string from applet = " + inString);
    String query = inString;
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@112.21.2.233:1521:db_name","user","password");
    con.setAutoCommit(false);
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    //Get the GIF
    byte[] bytes = rs.getBytes(1);
    file = null;
    file = new FileOutputStream ("C:/jakarta-tomcat-4.0.3/webapps/ROOT/images/leslie111.gif");
    file.write(bytes);
    if ( file != null )
    file.close();
    } catch(Exception e) {
    System.out.println("Not Stored File");
    e.printStackTrace();
    System.out.println("End Servlet");
    Please help me.....
    Thanks in advance ...
    Mary

    Greetings,
    //Setup servlet connection
    URLConnection servletConnection = servletURL_bytes.openConnection();
    ...Here's the first problem: your servlet is an HttpServlet but your applet is treating it as though it is a GenericServlet. The above should correctly be:
    HttpURLConnection servletConnection = (HttpURLConnection) servletURL_bytes.openConnection();Note: using a "generic" URLConnection will, of course, "work". However, by instead using an HttpURLConnection (to communicate with an HTTP resource), your applet will also gain significant ease in working with the HTTP protocol - parsing server responses (remember, servlets run as extensions, not replacements, of their hosting servers), for example - as in any one of, currently (http://www.w3.org/Protocols/rfc2616/rfc2616.html), 40 possible status codes... - not to mention...
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true); // to allow us to write to the URL
    servletConnection.setUseCaches(false); // to ensure that we do contactHere's a subsequent problem: your servlet is expecting the data to arrive by way of... er... "POST" (no pun intended ;). However, the default 'HTTP request method' is "GET". So here should also be:
    servletConnection.setRequestMethod( "POST" );However, it should be noted that in the case of "POST"-ing file data, it must be sent as a multipart message and this can be a literal "pain in the neck" to manage. Therefore, it is far better to HTTP "PUT" the file to the server - which can easily be done as is coded in your applet - though your servlet must, in turn, be refactored to respond to such a request. Of course, all of this "PUT"-ing and "POST"-ing can be dispensed with entirely by simply refactoring your servlet to be a GenericServlet, though you will also have to devise your own protocol for communicating (e.g. success or failure) between the tiers...
    Please help me.....I hope this helps.
    Thanks in advance ...
    MaryRegards,
    Tony "Vee Schade" Cook

  • How can I extract multine data using a regex? ... driving me nuts!!

    Hi everyone,
    I have a file which I'm interested in extracting information from. Here is a snippet:
    CGCNNNNGTAGTC
    TAGTCNN
    ... my goal is to create a regex which extracts out everything beyond the N (on the first line), along with anything on the next line which is not N.
    As a result, my desired outcome is "GTAGTCTAGTC"
    What I've worked on sofar (for my regex) is:
    Pattern p = Pattern.compile("(N[ATGC].*)\\r\\n[ATGC].*N", Pattern.MULTILINE);I've worked on it for sometime now, and am very interested in advice as-to how I can extract my desired information.
    Thanks once again,
    p.
    Edited by: phosse1 on Apr 9, 2009 8:37 PM
    Edited by: phosse1 on Apr 9, 2009 8:38 PM

    Till one of the regex gurus comes around to shorten the regex by 50% and increase the readability and efficiency by 1000% ;-)import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class CrossLineMatcher {
       public static void main(String[] args) {
          String[] inputs = {
             "CGCNNNNGTAGTC\n" +
             "TAGTCNN",
             "CGCNNNNGTAGTC\r\n" +
             "TAGTCNN",
             "CGCNNNNGTAGTC\r" +
             "TAGTCNN",
          String regex = "(?m)(?<=N)([^N]+)(?:$[\\r\\n]+^)([^N]+)(?=N)";
          Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
          for (String input : inputs) {
             Matcher matcher = pattern.matcher(input);
             while (matcher.find()) {
                System.out.println(matcher.group(1)+matcher.group(2));
          System.out.println("=======================");
          regex = "(?m).*?N([^N]+)(?:$[\\r\\n]+^)([^N]+)N.*?";
          for (String input : inputs) {
             System.out.println(input.replaceAll(regex, "$1$2"));
    everything beyond the N (on the first line), along with anything on the next line which is not NYou want to express a match for "anything that is not N", use [^N]
    [ATGC] means "anything that is A, T, G or C"
    db

  • How can I lock planning data using SEM-BPS Status tracking monitor

    Hi,
    What are the pre-requisites for being able to lock planning data when using certain header characteristics
    in customizing the Status and Tracking System in BPS ?
    I have done the following and expect the locks to be set, but they are not set and the data is still available for planning :
    1. Assigned the 0COMPANY hierarchy to a subplan with a planning area which has header characteristics : VERSION and CALYEAR.
    Header  characteristic customization is as follows :
    CALYEAR = 2005
    VERSION = V1
    2. Have set the status of all nodes in the hierarchy to 'approved' .
    3. I execute a Web planning interface for this planning area with a selection of a 0COMPANY within this hierarchy, PLANYEAR = 2006, CALYEAR = 2005 and expect the plan to be locked but its not.
    Could someone kindly explain why ?
    Regards.
    PS : Hope the scenario is clearly explained.

    Hello Anuradha,
    The plan data should be locked after the status is switched if
    - the package selection used in the planning function or planning layout is entirely contained in the header selection
    - you do not access the plan data via a multi area
    - the user does not have the authorization "STS_SUP" (super user).
    It is important to note that the characteristic used to define the hierarchy is not used in the locking. The characteristic is only used to define the hierarchy.
    In your example only the characteristics year and version are relevant for locking as these are the only ones used in the header selection. The data should be locked if the package selection is year = 2005 and version = V1. If you have a selection like year = 2005 and version = V1, V2 then the data is not locked as the selection is not completely contained in the header selection. Note that even if you only use version V1 in your selection but if you use a planning layout that has V2 in a comparison column then the system will enlarge the selection and data would not be locked.
    Best regards,
    Gerd Schoeffl
    SAPNetWeaver RIG BI

Maybe you are looking for