Database interaction

is there any method in java so we can take input from text file and save output in text file ???????????
i m taking about standalone application

Continuing....
A reader using both FileReader and Scanner:
import java.util.Scanner;
import java.io.FileReader;
import java.io.IOException;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class UsingScannerPattern implements ActionListener{
     private static JFrame frame;
     private static JButton find, clear, exit;
     private static JTextField textBox;
     private static JTextArea searchResults;
     private static JPanel panel1, panel2, panel3;
     private static FileReader filereader;
     private static Scanner reader;
     public UsingScannerPattern(String windowTitle) {
          frame = new JFrame(windowTitle);
          find = new JButton("Find");
          clear = new JButton("Clear");
          exit = new JButton("Exit");
          textBox = new JTextField(20);
          searchResults = new JTextArea(20, 20);
          panel1 = new JPanel();
          panel2 = new JPanel();
          panel3 = new JPanel();
          find.addActionListener(this);
          clear.addActionListener(this);
          exit.addActionListener(this);
          Label label1 = new Label("String");
          panel1.add(label1);panel1.add(textBox);
          panel2.add(searchResults);
          panel3.add(find);panel3.add(clear);panel3.add(exit);
          frame.add(panel1, "North");
          frame.add(panel2);
          frame.add(panel3, "South");
          frame.pack();
          //frame.setResizable(false);
          frame.setVisible(true);
     public void actionPerformed(ActionEvent e){
          if(e.getSource() == exit){
               System.exit(0);
          if(e.getSource() == clear){
               textBox.setText("");
               searchResults.setText("");
          if(e.getSource() == find){
               getResultsFromFile(textBox.getText());
     public void getResultsFromFile(String patternstr){
          try{
               filereader = new FileReader("file_to_read.txt");
               reader = new Scanner(filereader);
               reader.useDelimiter(System.getProperty("line.separator"));
               Scanner splitter;
               String fileLine;
               String partialString;
               //reader.useDelimiter(System.getProperty("line.Separator"));
               while(reader.hasNext()){
                    fileLine = reader.next();
                    splitter = new Scanner(fileLine);
                    splitter.useDelimiter("\\s*,\\s*");
                    while(splitter.hasNext()){
                         partialString = splitter.next();
                         if(partialString.equals(patternstr)){
                              if(searchResults.getText().length() == 0){
                                   searchResults.setText(fileLine);
                              }else{
                                   searchResults.setText(searchResults.getText() + "\n" + fileLine);
                              //break;
                    splitter.close();
               reader.close();
               filereader.close();
               }catch(IOException e) {
               JOptionPane.showMessageDialog(null, e.getMessage(), "ERROR", JOptionPane.ERROR_MESSAGE);
     public static void main(String args[]){
          new UsingScannerPattern("Using paterns");
}

Similar Messages

  • EAI is just about  WS and database interaction or WS and What

    Salut,
    I want a straightforward answer for this question
    EAI: is it about WS and legacy database interaction or what ?

    Hello,
    Have you take a look to BPEL (Business Process Execution Language) that is a language that use Web Services to define your business process.
    Take a look to the BPEL page on OTN and you will learn about what can WS give you in term of EAI. For example Oracle Application server with its adaptor based on JCA allow you to publish this JCA information as Web Service so you can leverage any legacy system...
    - BPEL Page
    Regards
    Tugdual Grall

  • Can oracle database interact with sysbase database in real-time?

    There are two database,one is oracle,one is sysbase,sysbase is produce database.My program only can visit oracle database,and can't directly visit sysbase database.My question is whether there is a directly link from oracle database to sysbase database,when I visit oracle,oracle database can interact with sysbase database through this link real time? How to realize above function? Please give plan for it.
    Thanks in advance!
    Best regards,
    Edward

    Yes there is. You have to create heterogeneous connection between these two databases
    Take a look at below links:
    http://www.dba-oracle.com/t_heterogeneous_database_connections_sql_server.htm
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:13401716754850
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96571/repmultdemo.htm

  • Shoudl I use ESB services for every database interaction

    I have an orchestrated business process that interacts with an internal database multiple times. Shoudl I use an ESB between the BPEL process and the database or is it better to use ESB's only for volatile or external services.
    The database is unlikely to change and most of the calls are going to be static with little or no change therefore I cannot decide whether or not to use ESB's for these calls or not. does anyone have any opinions?

    BPEL Orchestration provides the ability to update a number of employee details through a set process. The services called from the BPEL process are non-agnostic services that are specific to this process only. This means they are not going to be reused within the business and therefore I cannot decided whether I can justify the use of ESB services within this process.
    I disagree with the comment that ESB services shoudl be used for all services, because if this was the case why have database adaptors available as BPEL partner links?

  • J2sdk1.4 takes higher response time in database interaction than jdk1.3

    Hi All
    I am working on performance issues regarding response time . i have upgraded my system from jdk1.3 to j2sdk1.4 . I was expecting the performance gain in terms of response time in j2sdk1.4. but to my surprise it shows varied results with my application. it shows that j2sdk1.4 is taking higher time for executing the application when it has to deal with database. I am using oracle 9i as the backend database server.
    if any body has the idea about, why j2sdk1.4 is showing higher responce time while interacting with database as compare to jdk1.3. then do let me know this.
    Thanx in advance

    Hi All
    I am working on performance issues regarding response time . i have upgraded my system from jdk1.3 to j2sdk1.4 . I was expecting the performance gain in terms of response time in j2sdk1.4. but to my surprise it shows varied results with my application. it shows that j2sdk1.4 is taking higher time for executing the application when it has to deal with database. I am using oracle 9i as the backend database server.
    if any body has the idea about, why j2sdk1.4 is showing higher responce time while interacting with database as compare to jdk1.3. then do let me know this.
    Thanx in advance

  • Edge database interaction "Proof of Concept"

    Hi all-
    I've read several posts asking about the possibility of Edge interacting with an outside source such as a database.
    Thanks to a few posts and examples here (redesign for the example of the mailto" project and Lee Brimelow for the folowing link:
    http://www.gotoandlearn.com/play.php?id=168)
    I have built a "Proof of Concept" page that, all within Edge, let's a user click a button to search a database, pulls the results and displays them within the Edge animation...
    If people are interested, I can make a complete tutorial that walks through each aspect of this, including how to easily create a JSON file for Edge to import and use...
    Here's a link to the working example.  Right now I have it limited to pulling 5 items from the database but what you see  IS live from a MySQL database!
    http://www.fundraiserhp.com/json/send_lasso.html
    Let me know if anyone is interested in a tutorial for this...
    James

    OK, don't everyone "bash" me at once :-)
    I apologize for the delay but some work issues cam up I needed to take care of.  I don't know how good this tutorial is, I was a bit rushed!
    There are 3 parts to the video:
    Part 1: Creating links within an Edge animation to another Edge animation that displays the database information.
              https://www.youtube.com/watch?v=NrEu5vfXCgQ
    Part 2: Creating the "Container" symbol to hold the database information inside an Edge animation.
              https://www.youtube.com/watch?v=Wwb6TFTx3sc
    Part 3. Calling the database and creating a .json file with the database info for the Edge amination to impoort.
              https://www.youtube.com/watch?v=KMqGf_eyKok
    Each tutorial video has a link to the next video so it should be easy to follow by just going to the first video:
    https://www.youtube.com/watch?v=NrEu5vfXCgQ
    Enjoy!
    James

  • BPM and database interaction

    I am writing my thesis on processes and use the OBPM product.
    I need to connect it to an external database. I managed to make some steps towards this goal, but the big picture is missing.
    Can anyone show me a documentation on this topic or help me directly?
    Thanks in advance
    Edited by: bpmL on Feb 2, 2009 3:13 AM

    I need help with this. I tried to make my BPM object to fill one pull-down list from Oracle database and I just don't get it to work. I get a java nullpointerexception.
    The weird thing is that when I debug the method, it works fine. But when I open the presentation in workspace, it just gices out the nullpointerexception. How can it work in debug but not when run in workspace?
    The code is this:
    listValues as String[String]
    externalResource as String
    sql as String
    externalResource = "tuotaDB"
    sql = "SELECT DISTINCT TYOKAN.TUN AS TUN, " +
    "TYOKAN.SELI1 AS SELI1 FROM TYOKAN, TYO_KP WHERE TYO_KP.TUN = TYOKAN.TUN " +
    "AND TYOKAN.TUN IS NOT NULL AND TYOKAN.SELI1 IS NOT NULL "
    for each row in DynamicSQL.executeQuery(sentence : sql, implname : externalResource) do
    listValues[String(row["TUN"])] = String(row["SELI1"])
    end
    return listValues
    The name of the Oracle database external resource is tuotaDB and the name of the catalog item is TUOTA. I have imported the tables mentioned above into that cactalog.
    This is part of the error messages that I get:
    exception occurred running controller: fuego.xobject.runtime.components.XOInputController
    javax.servlet.ServletException: exception occurred running controller: fuego.xobject.runtime.components.XOInputController
    The task could not be successfully executed.
    Reason: 'java.lang.NullPointerException'.
    Caused by: java.lang.NullPointerException
    fuego.lang.ComponentExecutionException: The task could not be successfully executed.
    Reason: 'java.lang.NullPointerException'.
    Caused by: java.lang.NullPointerException
         at fuegoblock.sql.DynamicSQL.executeQuery(DynamicSQL.java:316)
         at fuegoblock.sql.DynamicSQL.executeQuery(DynamicSQL.java:93)
    Error workspace-1247845516304
    The task could not be successfully executed.
    Reason: 'java.lang.NullPointerException'.
    Caused by: java.lang.NullPointerException
    fuego.lang.ComponentExecutionException: The task could not be successfully executed.
    Reason: 'java.lang.NullPointerException'.
    So, what have I done wrong? There are several different ways to write that code as mentioned already in this thread, but the results are the same. If I comment out the line adding values into list then the script goes through fine. But the script goes through fine in debug mode also, but not when run in workspace.
    Please, help me, I have spend a lot of hours into this...

  • Database interaction in JSP - Error 500?

    Hi all,
    I made a page PAGE1,jsp which retrieves data(String S1, S2) from database. It has a submit button which on on clicking directs to PAGE2.jsp. PAGE2.jsp is shown below partially:
    <%!     InitialContext  ctx =null;
         Connection conn= null;
         ResultSet rs = null;
         DataSource ds = null;
         Statement stmt = null;
    %>     
    <%
         ds=(DataSource)ctx.lookup("MyDS");
         conn= ds.getConnection();
         stmt = conn.createStatement();
         String s1 = request.getParameter("S1"); //retrieved from PAGE1.jsp
         String s2 = request.getParameter("S2"); //retrieved from PAGE1.jsp
         stmt.executeUpdate("update TABLE1 set FIELD2='"+s2+"'" "where FIELD1="+s1+);
         rs=stmt.executeQuery("select * from TABLE1");
    %>
    <%
         while(rs.next()) {
    %>
    <tr>
         <td> <%=rs.getInt(1)%> </td>
    </tr>
    <% }
         rs.close();
         stmt.close();
         conn.close();
    %>The page when run gives Error 500- internal server error (The server encountered an unexpected condition which prevented it from fulfilling the request.). Following is the serverlog:
    Servlet failed with Exception
    java.lang.NullPointerException
    at jsp_servlet._pages._display.__PAGE2._jspService(__PAGE2.java:163)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    -Thank you
    Edited by: student21312 on Feb 13, 2008 10:39 PM
    Edited by: student21312 on Feb 14, 2008 12:22 AM
    Edited by: student21312 on Feb 14, 2008 12:24 AM
    Edited by: student21312 on Feb 14, 2008 12:26 AM

    Don't do that in JSP's. There they are not for.
    Write a simple DAO class which does the task. It will not only free JSP's from unnecessary business logic, but also improve maintenance, reusability and debugging a LOT.
    Do you understand when a NPE is been thrown anyway?

  • Webservices with Database interaction

    Hi,
    I am new to Web Services.
    I have a requirement to retrieve database records using web services.
    I am uisng Tomcat and JWSDP or AXIS
    Thanks

    Sorry, but for some reasons the way you formulated this question really demotivates me to give any help.
    Please ask questions the smart way: [http://www.catb.org/~esr/faqs/smart-questions.html].

  • How to retrieve data using logical database and custom select options

    Hi all,
    I have a selection screen which is displayed by logical database PSJ and I have two select options of my own. I need to retrieve data based on both selection screen of logical database and my own select options. How can I do it?
    Thanks in advance.

    Hai Gupta
    Check the following Document & Links
    1. A logical database is in fact
    a program only.
    2. This LDB provides two main things :
    a) a pre-defined selection screen
    which handles all user inputs and validations
    b) pre defined set of data
    based upon the user selection.
    3. So we dont have to worry about from
    which tables to fetch data.
    4. Moreover, this LDB Program,
    handles all user-authorisations
    and is efficient in all respects.
    5. tcode is SLDB
    good info about Logical Database. you can check the link.
    http://www.geekinterview.com/question_details/1506
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Re: How to Create and Use ldb in reports?
    Re: Logical databases
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    Functions for displaying and changing logical databases:
    Call Transaction SE36 or
    Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
    Interaction between database program and report:
    During program processing, subroutines are performed in the database program and events are executed in the report.
    To read data from a database tables we use logical database.
    A logical database provides read-only access to a group of related tables to an ABAP/4 program.
    advantages:-
    The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
    i)An easy-to-use standard user interface.
    ii)check functions which check that user input is complete,correct,and plausible.
    iii)meaningful data selection.
    iv)central authorization checks for database accesses.
    v)good read access performance while retaining the hierarchical data view determined by the application logic.
    disadvantages:-
    i)If you donot specify a logical database in the program attributes,the GET events never occur.
    ii)There is no ENDGET command,so the code block associated with an event ends with the next event
    statement (such as another GET or an END-OF-SELECTION).
    1. transaction code SLDB.
    2.enter name z<ldb-name>
    3.create
    4.short text
    5.create
    6. name of root node (here Ekko)
    7. enter short text (f6)
    8.node type -> data base table.
    9.create
    10 change logical DB
    riht click on ekko and insert node
    here node name ekpo
    11.create
    12. click on selections
    13. press no Should the changed structure of Z<ldb name> be saved first.
    14.select tables which you want to join.
    15.transfer
    16 now you have to o to coding part.
    17. save
    activate.
    19.click to src code
    double click on first include and activate
    Regards
    Sreeni

  • Database...  uh... shifting

    Howdy,
    I have an application server that relies on data in an oracle database. This is a development environment. I'd like to be able to shift from one version of the database to another quickly and easily. The reason for this need is that I want to be able to shift between different installs of the application in my development environment - some installs might be clean out-of-the-box implementations, some with sample data, some with customizations I've developed, etc.
    If I were using MS SQL Server, I would stop my application server, detach one logical database (& logs) from the database server, attach my desired version, then start my application server. If I script it, I can shift from one version to another in under a minute.
    I'm familiar with oracle, and I know that the terminology and structure are different, but I'm hoping someone might be able to understand what I'm requesting and come up with a solution for me. Backup & restore or export/import aren't ideal options for me since these are fairly large databases and those operations can be time consuming.
    The underlying structure between these different installs can be slightly different (some may have more tables than others). Oracle settings between different installs is static.
    Like a lot of "enterprise" apps, direct database interaction is minimal, the application is not optimized for any particular database platform, and the database platform is essentially a high-performance storage engine for application data. I didn't write it, just trying to provide enough information so that someone can help me out.
    Currently working with 11g/RHEL, but a solution that isn't platform dependent or specific to an oracle version is desirable.
    I appreciate your time and your assistance,
    Steve

    Steve-a-rama wrote:
    It uses oracle libraries to connect, and I can configure an SID for alternate implementations.
    But if I have two schemas online, isn't oracle using twice the resources? Or does it share resources between schemas?
    If it does use twice the resources, can I take one offline when it is not being utilized? (my dev box does not have a great deal of RAM)
    Sorry that these are basic questions.While a one conceptual level one might think of an Oracle schema as being equal to a MS database, that is still not an exact analogy.
    The database is a collection of data files that contain database objects. The instance is the memory and processes that access and manage the database. The schema is simply a collection of objects that belong to one user account - a namespace if you will. A schema is just a collection of objects within a given database. There is no such concept of a schema being 'online' or not. There is no such concept as logging on or connecting to a schema.+ One simply connects (logs on) to the instance+ (commonly aka the "database", but to be precise, that is not accurate). When one connects, one has a default schema that all unqualified object references will resolve to.

  • Database Connection problem please help

    Hi,
    I have a servlet that basically connects to the database if the userid and password is correct.
    I have a "login.html" page where the user enters the "userid" and "password".The servlet does the checking and grants access to the user.
    My question is as follows.As soon as I startup tomcat type in the url login.html,then press the submit button,(both the fields are blank) the servlet says "ok" this is this information is present in the database.It should say "not ok".Hope I question is clear.The code for the servlet is given below.
    package package1.structure;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    public class AuthenticateServlet2 extends HttpServlet {
    private String user="";
    private String pass="";
    private String username="";
    private String password="";
    private String message1="";
    public void init() {
    try{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        System.out.println("Driver loaded successfully");
       }//close try
    catch (ClassNotFoundException e) {
    System.out.println(e.toString());
    }//close catch
    }//close init() method
    public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
    } //close doGet
    public void doPost(HttpServletRequest request,HttpServletResponse response)
    throws ServletException, IOException
      user = request.getParameter("username").trim();
      pass = request.getParameter("password").trim();
      System.out.println("*"+user+"*");
      System.out.println("*"+pass+"*");
      String message = null;
    try{
      Connection con= DriverManager.getConnection("jdbc:odbc:MyDS");
      System.out.println("Successfully connected to database");
      PreparedStatement pstmt;
      pstmt = con.prepareStatement("SELECT username,password FROM users" + " WHERE username ='" + user + "'" +
      " AND password='" + pass + "'");
      ResultSet rs = pstmt.executeQuery();
      if(rs.next())
          username = rs.getString(1);
           password = rs.getString(2);     
    if (username != null && password != null && user.equals(username) && pass.equals(password) ){
        message ="ok";
        PrintWriter out = response.getWriter();
        out.print("<B>" + message + "</B>");
        //response.sendRedirect ("http://localhost:8080/thankyou.html");
    }//closes the if statement
    else {
         message="not ok";
         PrintWriter out = response.getWriter();
         out.print("<B>" + message + "</B>");
        //response.sendRedirect ("http://localhost:8080/sampleapp/login.html");
    }//close else statement
    }//closes 2ndtry
    catch (SQLException e) {
    System.out.println(e.toString());
    }//closes 2ndcatch
    }//close doPost
    }//close classKindly let me know ASAP.
    Regarding the database.The fields in the database are "username" and "password" and it has one tuple
    "xyz" and "xyz"
    Hope that my question is rightly put.
    Thanking you
    AS

    Actually, I think the servlet is doing the right thing
    by printing "ok". A quick glance at your code tells
    me that username and password are both members of your
    servlet class and initialized to "". Neither is null,
    and both are blank.
    If your HTML page sends user and pass as blank
    strings, you'll do a database query for those values.
    If they don't appear in the database, your ResultSet
    will have no rows and the username and password data
    members will not be updated.
    When you get to your if test, neither username nor
    password is null and both are equal to the values
    passed in from the HTML. Hence the "ok".
    If you initialize your username and password members
    to null this might still work.
    Be sure to set them back to null when you finish the
    test.
    If you take all that JDBC code out of the servlet and
    isolate it into its own class, you can test it out by
    feeding it valid and invalid username and password
    combinations. Once you've got that working perfectly,
    you can just have the servlet instantiate your
    database object and call its methods. If you have any
    problems after that point, you know they're due to the
    servlet and not the database interactions.
    Right now the database and servlet are confounded.
    Separate them out and you might make faster progress.
    - MODHello,
    Thanks for the reply.Will consider your points for a proper coding.Will keep posting.
    AS

  • Running the same query against numerous databases

    My organization has 20+ clients. Each client has a separate database in the same MSSQL server*. For these purposes, the databases are structurally identical. I've been tasked to gather information from tables in all of these databases. I can use the same query on multiple clients - my issue is switching between databases.
    The naive solution would be for me to declare 20+ DataSource instances, and have some mapping from client name to DataSource. I think that's going to be a real mess and my inclination is to avoid it.
    Another possibility would be dynamically generating the PreparedStatement based on the client, something like
    "SELECT foo, bar " + "FROM " + client.getDatabaseName() + ".dbo.my_table";
    My understanding, though, is that it's a bad practice to have dynamically generated prepared statement calls and not possible to parameterize the 'from' clause.
    Another thing I've been digging around at is using a transaction and an SQL Server call to alter what database calls from that transaction go to. I thought that could be done, but I'm not finding anything which suggests it's possible.
    I guess I've identified my problem, but I'm thrashing on how to solve it. I'm still newish to non-trivial database interactions, so I'd appreciate any input. If I posted this in the wrong place, please feel free to yell at me and move it.
    Thanks in advance,
    Eric
    * Not my fault. I'm new.

    I'm collection usage and storage metrics. "Client X has 200 records, Client Y has 250. Client X has 15 active users, Client Y has 12."
    The data is being read from the client databases and stored into a separate metrics database.
    I anticipate it will be mostly select count() calls.
    I can. For the maintenance reasons I mentioned above, I'd rather not have to maintain all those datasources if I don't have to.
    No, the invocations will be sequential.
    for (each metric type) {
        for (each client) {
            gather information;
            add to batch
        update batch in metrics database
    }I guess I was hoping there was a Sekrit SQL way to swap what database inside a server instance the connection was pointing to. I'm guessing that's not going to happen, and I'm left with N datasources for N clients or generated preparedStatements which swap out the database name in the FROM portion.
    The data is being written to a table in a single, separate metrics database.
    I'm trying not to, honest.
    Edited by: 919852 on Mar 12, 2012 8:38 AM

  • How to fasten the XML searching compared to database

    Hi,
    i'm putting the whole scenario here:
    It will be so helpful if u can help me.
    -------------------the doubt----------------------------
    i'm having an xml in the following format
    <LOV>
    <RECORD NO="1">
    <FIELD NAME="EMPNO">E1001</EMPNO>
    <FIELD NAME="EMPNAME">MR. X</EMPNO>
    <FIELD NAME="TEAM">PRODUCT TEAM</EMPNO>
    </RECORD>
    <RECORD NO="2">
    <FIELD NAME="EMPNO">E1002</EMPNO>
    <FIELD NAME="EMPNAME">MR. Y</EMPNO>
    <FIELD NAME="TEAM">TECHNOLOGY TEAM</EMPNO>
    </RECORD>
    </LOV>
    like this there will be minimum 5000 records and what i need is to search this xml(using DOM) by specifying a condition like
    EMPNO=E1001
    or EMPNAME=MR.X or EMPNO=E1* etc etc.
    i did this with the help of NodeIterator.
    but the problem is :
    this is done to avoid database interaction.
    and this s taking 2-3 secs to query and once it is stored as an object it s taking .3 secs.
    but when i tried to query the same no and sort of records straight from a database it s taking only .1 sec everytime.
    Now my question is : Is it possible to use any other method in xml parsing so that i can make the xml quering much faster than database query.
    pls help if possible
    Ranjith.M

    this is not pure JAXP but a behind the scene hack: use the org.apache.xpath.CachedXPathAPI and run XPath queries on your DOM.
    simple sample:
    // getMyXpathAPI() returns a singleton CachedXPathAPI
    Node node = getMyXpathAPI().selectSingleNode(doc, xpath);

  • Selection part of Logical Database

    I read about logical database somewhere on the net but it was not so clear. Can anyone explain to me about the selection part of the logical database???

    Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables and linking them to executable ABAP programs while setting the program contents. You edit logical databases using the Logical Database Builder in the ABAP Workbench.
    However, since Release 4.5A, it has also been possible to call logical databases independently of this tool using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. It is also possible to call a logical database more than once in a program, if it has been programmed to allow this. This is particularly useful for executable programs, allowing them to use more than one logical database and process a database more than once.
    Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS using an interface work area.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm
    A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.
    GO THROUGH LINKS -
    http://www.sap-basis-abap.com/saptab.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
    /people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
    Re: **LDB**
    www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html
    www.sap-img.com/abap/abap-interview-question.htm
    www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm
    Logical databases are SAP standard programs that are desinged with selections screens that helps easy retrival and access of data from various tables in and efficient manner.
    You can get to know more about the logical databases from the SAP documentation or the following links.
    A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.
    Advantages of Logical database -
    1) No need of programming for retrieval , meaning for data selection
    2) Easy to use standard user interface, have check completeness of user input.
    Disadvantages
    1) Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.
    GO THROUGH LINKS -
    http://www.sap-basis-abap.com/saptab.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
    1. A logical database is in fact
    a program only.
    2. This LDB provides two main things :
    a) a pre-defined selection screen
    which handles all user inputs and validations
    b) pre defined set of data
    based upon the user selection.
    3. So we dont have to worry about from
    which tables to fetch data.
    4. Moreover, this LDB Program,
    handles all user-authorisations
    and is efficient in all respects.
    5. tcode is SLDB
    good info about Logical Database. you can check the link.
    http://www.geekinterview.com/question_details/1506
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Re: How to Create and Use ldb in reports?
    Re: Logical databases
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    Functions for displaying and changing logical databases:
    Call Transaction SE36 or
    Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
    Interaction between database program and report:
    During program processing, subroutines are performed in the database program and events are executed in the report.
    To read data from a database tables we use logical database.
    A logical database provides read-only access to a group of related tables to an ABAP/4 program.
    advantages:-
    The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
    i)An easy-to-use standard user interface.
    ii)check functions which check that user input is complete,correct,and plausible.
    iii)meaningful data selection.
    iv)central authorization checks for database accesses.
    v)good read access performance while retaining the hierarchical data view determined by the application logic.
    disadvantages:-
    i)If you donot specify a logical database in the program attributes,the GET events never occur.
    ii)There is no ENDGET command,so the code block associated with an event ends with the next event
    statement (such as another GET or an END-OF-SELECTION).
    1. transaction code SLDB.
    2.enter name z<ldb-name>
    3.create
    4.short text
    5.create
    6. name of root node (here Ekko)
    7. enter short text (f6)
    8.node type -> data base table.
    9.create
    10 change logical DB
    riht click on ekko and insert node
    here node name ekpo
    11.create
    12. click on selections
    13. press no Should the changed structure of Z<ldb name> be saved first.
    14.select tables which you want to join.
    15.transfer
    16 now you have to o to coding part.
    17. save
    activate.
    19.click to src code
    double click on first include and activate
    Regards
    Vasu

Maybe you are looking for

  • Time Machine and Upgrading to SL

    Hello all, Sorry for the amateur questions, but I'm looking for some guidance on using Time Machine when upgrading from Leopard to Snow Leopard on my mid-2009 MBP. I tried upgrading to SL months ago when it first came out. I did not use Time Machine

  • I have never been so angry at apple (Apple ID)

    I had a problem with my domain and I thought I had lost my email address so I changed my primary email address for a short time to one that I had access to. Now that I got my domain back I changed my apple ID back to what it was before, but all my pr

  • Ora-12514 and dns

    Hi im new to oracle and im having trouble in connecting oracle 10g XE with asp.net2005 and im using windows 2003 server.i installed the odt.net tools and every thing looked well untill i tried to connect with database using connect to oracle in asp.n

  • N93 and TV-out

    Does anybody know if it is possible to use the TV-out function with a slide show and to do a remote update (on the slide show) at the same time? The first question should perhaps be: Is it possible to (remote)control the phone over the 3G net?

  • Query regarding patches - are they cumulative?

    We are in process of upgrading the BI Servers (BIS) and Client Machines (WAS) from BI XI R4.1 SP04+Patch1 To Pach4. Downloaded Patch4 from SAP Portal is having 3 components (Server, Client, Dashboard) whether all these 3 components are cumulative of