Retrieve data  from entity bean to struts and display in JSP

I am integrating Struts+EJB3.0.
Now i need to retrieve data stored in mysql database through entity bean to struts framework*(Action Form*).Then i need to display it in JSP page.(display using combo box).
Please Any one give suggestions!!!!!
Thanks in advance

I got the solution.
--Jagan.+                                                                                                                                                                                                                               

Similar Messages

  • Retrieving data from TCP/IP in xml and displaying values?

    Hey, I am using a program to retrieve data from a machine and outputting it in xml to the localhost.  On a seperate computer, I am trying to create a client application to read the xml data from that IP host and just output the important values instead of the whole script.  I am new to Labview and programming, has anyone written a program similar to what I am trying to accomplish?  I searched for it but couldn't quite find what I was looking for.  I really could use some help with trying to figure this out and appreciate any help or advice you could give me.   

    Where did you search? There are examples that ship with LabVIEW that show you how to do client-server applications using TCP/IP. Did you try those? You would need to add the parsing of the data you receive (i.e., the XML).

  • How to retrieve information from entity beans?

    Hi all!
    I have a problem while trying to get information from entity beans. Here it goes:
    There are two entity beans with 1:N relationship between them.
    A FacadeSB is used to find a single record in one entity bean, using the findbyPrimaryKey method.
    What is required now is to get information from the other entity bean matching the record found from the first entity bean.
    to become more clear, the db schema is like that:
    vehicle_table
    vehicleid (vehicle_pkey)
    name (type of vehicle i.e. car, bike, atv, etc)
    brand_table
    brandid (brand_pkey)
    name (brand name e.g. ferrari)
    vehicleid (foreign key to vehicle_table)
    a FacadeSB gets the vehicle_table info and passes them to a servlet generated dropdown.
    what is the best way to populate a brand dropdown based on the vehicle dropdown selection?
    thanx in advance
    I hope the problem definition is clear enough for you guys...

    thanx for the reply
    i'm ok with the finder methods you suggested. my main concern in whether to create another FacadeSB to access the brand EJB. I don't believe that's the way to go on i.e. creating a session bean for every EJB created. Shall i use the VehicleFacadeSB to access brand EJB as well?
    I can undestand that such an implementation would be a quick fix as well as not such a resources hungry hack but on the other hand, would it make any sense architecturally?
    any suggestions?
    Zac

  • Retrieve data from a bean into a Servlet

    Hi,
    I created a simple JSP file called index.jsp situated in application root, then I associated this JSP with a java bean in order to collect data after the form submission, the attribute Action inside the Form tag points on a Servlet called Login situated in the application com.myapp.servlets package.
    the problem is that, using the scope="session" in the JSP page, I'm able to get catch the bean generated after the submission of the form, even the action is the Servlet called Login neither a back to the currest JSP or a redirection to another JSP, but in the same time, when I try to use bean methods to read the data (username, password) it gives null as result, I'm not able to understand the behavior of the bean which is created via Form submission but unreachable via the Servlet.
    herese the code
    the JSP (index.jsp)
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <jsp:useBean id="MyBean" scope="session" class="com.datalog.beans.LoginBean"/>
    <jsp:setProperty name="MyBean" property="*"/>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Document sans nom</title>
    </head>
    <body>
    <table width="100%" border="1">
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td><form name="form1" method="post" action="doLogin">
          <table width="100%"  border="0" cellspacing="0">
            <tr>
              <td width="30%">username : </td>
              <td><input name="username" type="text" id="username"></td>
            </tr>
            <tr>
              <td>password : </td>
              <td><input name="password" type="password" id="password"></td>
            </tr>
            <tr>
              <td> </td>
              <td><input type="submit" name="Submit" value="Envoyer"></td>
            </tr>
          </table>
        </form></td>
      </tr>
      <tr><!-- in case when try to use without a servlet call-->
        <td>username after submission <jsp:getProperty name="MyBean" property="username" /><br>
         password after submission <jsp:getProperty name="MyBean" property="password" /></td>
      </tr>
    </table>
    </body>
    </html>The bean (LoginBean.java)
    package com.datalog.beans;
    import java.io.Serializable;
    public class LoginBean implements Serializable {
        private String username;
        private String password;
        public LoginBean(){
            System.out.println("i'm the bean ... "+this);
        public String getPassword() {
            return password;
        public void setPassword(String password) {
            this.password = password;
            System.out.println(this.password);
        public String getUsername() {
            return username;
        public void setUsername(String username) {
            this.username = username;
            System.out.println(this.username);
    }Servlet (Login.java)
    * Created on 14 d�c. 2004
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    package com.datalog.cpservlets;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import com.datalog.beans.LoginBean;
    * Servlet Class
    * @web.servlet              name="Login"
    *                           display-name="Name for Login"
    *                           description="Description for Login"
    * @web.servlet-mapping      url-pattern="/Login"
    * @web.servlet-init-param   name="A parameter"
    *                           value="A value"
    public class Login extends HttpServlet {
        public Login() {
            super();
            // TODO Auto-generated constructor stub
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
            // TODO Auto-generated method stub
        protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException,
            IOException {
            // TODO Auto-generated method stub
            super.doGet(req, resp);
        protected void doPost(
            HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
            // TODO Auto-generated method stub
            PrintWriter out = response.getWriter();
            out.println("<br><br>Servlet (Login) in use.<br>");
            out.println("username from request.getParameter : "+request.getParameter("username")+"<br>");
            out.println("password from request.getParameter : "+request.getParameter("password")+"<br>");
            out.println("<br><br>Trying to use the bean...<br>");
            HttpSession session = request.getSession();
            LoginBean myBean = (LoginBean)session.getAttribute("MyBean");
            out.println("supposed bean adr : "+myBean);
            out.println("<br>username from myBean.getUsername : <b>"+myBean.getUsername()+"</b><br>");
            out.println("<br>password from myBean.getPassword : <b>"+myBean.getPassword()+"</b><br>");
    }thank's.

    The code that would populate the bean is here:
    <jsp:useBean id="MyBean" scope="session" class="com.datalog.beans.LoginBean"/>
    <jsp:setProperty name="MyBean" property="*"/>
    When this code runs, it
    1 - creates a LoginBean (if one is not already present)
    2 - Populates the loginBean from the request parameters.
    But this code is currently running when you generate the login page - not when you push the submit button.
    Solutions
    1 - Submit the form to a JSP page which runs the jsp:setProperty tag and then forwards to your Login servlet
    2 - Retrieve the request parameters in your servlet and populate the bean. The jakarta commons BeanUtils are the standard way to go here. They are actually preferable to the jsp:setProperty tag which has some "features" in its use.
    Cheers,
    evnafets

  • Pull the data from legacy System into report and display with SAP data

    Hi Friends,
    My requirement is-
    Create report by processing data from SAP tables and prepare output.And Before displaying the output, I have to pull the data from non-sap system which is readymade (It will come as flat file with similar fields as Report structure has) and finally display the records from both SAP and Legacy System by filtering duplicates.

    Steps:-
    Define the file path on selection screen:-
      Selection screen data
        select-options   (s_)
          parameters     (p_)
          radio buttons  (r_)
          checkboxes     (x_)
          pushbuttons    (b_)
    SELECTION-SCREEN  BEGIN OF BLOCK block1 WITH FRAME TITLE text-f01.
    parameter:    p_file    type text_512 obligatory.
    Start-of-selection.
      data : l_fname type string. " File Name
      l_fname = p_file .
      call function 'GUI_UPLOAD'
        exporting
          filename                = l_fname
          filetype                = 'ASC'
          has_field_separator     = '#'
        tables
          data_tab                = lt_data
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          others                  = 17.
      if sy-subrc <> 0.
        message e000 with 'Unable to upload file from the PC'(t13).
      endif.
    lt_data is of same structure as the fields in the file.
    For filtering duplicates:-
    delete adjacent duplicates from lt_data.
    Now display the records using either ALV or using write statements.
    You can display the records in any of the way you want.

  • Problems with retrieving data from tables with 240 and more records

    Hi,
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
    I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
    First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
    I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
    I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
    So for the retrievals that hang I have something like:
    (3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
    (3260008): FETCH NEXT:(DBI_FETCHNEXT)
    and this is the last line,
    while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
    On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
    Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
    I will appreciate any comments/hints/help.
    Thank you very much.

    pgoel wrote:
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
    Thanks.

  • How to retrieve data from MDM using java API

    hi experts
    Please explain me the step by step procedure
    how to retrieve data from MDM using java API
    and please tell me what are the
    important classes and packages in MDM Java API
    thanks
    ramu

    Hi Ramchandra,
    You can refer to following links
    MDM Java API-pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49
    webinr of java API
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/89243c32-0601-0010-559d-80d5b0884d67
    Following Fourm Threads will also help.
    Java API
    Java API
    Re: usage of  java API ,
    Matching Record
    Need Java API for Matching Record
    Thanks and Regards,
    Shruti.
    Edited by: Shruti Shah on Jul 16, 2008 12:35 PM

  • ClickOnce WinForms Application to retrieve data from an Oracle Database

    I am hoping someone can help us.
    We are trying to create a ClickOnce WinForms Application that will allow our Customer Service group to retrieve data from an Oracle Database.
    We are currently able to use such a ClickOnce WinForms Application to allow our Customer Service group to retrieve data from SQL Server 2000 databases and even to a PICK Basic database. We use ole db drivers for these connections and keep the connection strings in a configuration file.
    Our primary question now is:
    1) What files would be needed on each client machine?
    Thanks for any pointers.
    :) Anne

    The problem has been fixed.
    If you wanna to load data from Oracle DB,the connect String should be like this:
    cnss.open "Provider=OraOLEDB.Oracle.1;data source=orcl;User Id=fdmitf;Password=fdmitf"
    besides, you should assign a value (True/False) to your function, as TonyScalese said in this post:
    Import from RDB Fails with "Error:Import failed.Invalid data or Empty..."
    Problem solved is always a great joy! Thanks!

  • Query Report:To Retrieve Data from A/R Invoice and A/P Invoice

    Hii Experts,
          I am a new Sap B1 Trainee.I am facing a problem when retrieving data from A/R Invoice and A/P Invoice in order to track
    Expenditure and Revenue according to a Bussiness partner,
    I am using union to retrieve the information,but it is saying a error that  Error Converting Varchar to Numeric and also
    i would like to know how can i show the total final payment by reflecting Downpayments in A/R Invoice and A/P Invoice
    With Regards
    Cherry.

    Hii.
    My Sap B1 version is 8.8.1 and patch level is 20. Actully i need a scenario where i can able to show both Expenditure and Revenue of a particular bussiness partner and profit/loss in a single query report.
    I need some tips regarding this,When i am doing union i am getting conversion error converting varchar to numeric when i take
    Sum(Line Total) from OINV and Sum(line total) OPCH group by docdate and docentry and BP .
    and another scenario is how to deduct A/P downpayment or A/R downpayment from A/P invoices and A/R invoice to get the final Revenue and Expenditure ..
    Thanks & Regards
    Cherry

  • How do i retrieve data from a powerbook whose screen lights up but displays nothing? I have a firewire and a second powerbook...

    how can I retrieve data from my old powerbook? It's screen lights up, but displays only pixelated blankness. I have a second powerbook and a firewire cable....

    It would probably be correct to assume that both PowerBook computers are equipped with FireWire. The article below could possibly be of interest to you. With a bit of luck, the old computer will be recognised.
    http://support.apple.com/kb/HT1661
    Otherwise, it may become necessary to open the old PowerBook and remove the hard drive. The drive can then be connected to an appropriate external USB adapter, and read via another Mac.
    Jan

  • DO Web Service allow you to retrieve data from database and make it pluggab

    Can Web Services allo you to retrieve data from the database and do they make the pluggable by allow you to plug them into any database.. how is that possible....

    Going through the javaee tutorial is one sure way of accelerating your learning curve, as almost every basic you will need to get your job done is explaiined well in there. i have been using it to learn building enterprise application and is awesome good resource.
    seriously consider downloading it
    java.sun.com/javaee/5/docs/tutorial/doc/

  • Retrieve data from 2 columns of 2 different tables and display in 1 column

    Hi,
    Is it possible to retrieve data from 2 different columns of 2 different tables and display it in the same column of a datablock in a form.
    For example:
    Table A
    Col1
    1
    2
    3
    Table B
    Col1
    2
    4
    5
    The column from the datablock in the form should display the following:
    1
    2
    3
    2
    4
    5

    You can create a view
    select ... from table_a
    union
    select ... from table_b
    and base the block on that.
    However, if you want to allow DML on the block it gets more complicated.

  • Process and Code for writing an RFC to retrieve data from IT0006 and IT0655

    Hi,
    Can some body tell me the process and code for creating an RFC to retrieve data from IT0006 and IT0655.
    Its very urgent........
    Waiting for an early reply.....
    Many thanks

    Hello Krishna,
          The process for creating an entry in infotype is as follows.
    1.First you get the personal number lock for upating.You can use function 
        module ' BAPI_EMPLOYEE_ENQUEUE ' or ENQUEUE_EMPREL.
    2.Pass the records to function module ' HR_INFOTYPE_OPERATION' with
       OPERATION - 'INS'.
    3.Unlock the Employee by using function moule 'BAPI_EMPLOYEET_DEQUEUE'.
    Regards,
    Manoj.

  • Process and Code for writing an RFC to retrieve data from IT

    Hi,
    Can some body tell me the process and code for creating an RFC to retrieve data from IT0006 and IT0655.
    Its very urgent........
    Waiting for an early reply.....
    Many thanks

    Inside your RFC you can directly use select on PA0006 & PA0655
    or use FM: HR_READ_INFOTYPE
    if you wan for multiple pernrs then cal the FM inside a loop or you can use the select query for multiple pernrs
    reward points if helpful

  • Retrieving Data from SQLite and make link with the ID of the retrieved data?

    Hello, first of all sorry if my english is bad as im from Mexico.
    I using HTML/Javascript/SQLite, and im having an issue while retrieving data from SQLite, all my querys work right, but when i try to select an Id, the Name, Firstname, and Lastname and only use the Name, Firstname and Lastname to print on screen and the Id to use as a link or OnClick query with the id more info from the name of the person..
    My SQLite query is the next one.
    var sql = "SELECT [sis_persona].[idPersona], [sis_persona].[Nombre], [sis_persona].[Paterno], [sis_persona].[Materno] FROM  [sis_persona] WHERE Nombre  LIKE '"+ nombre1+"%' AND Paterno LIKE '"+ paterno1+"%' AND Materno LIKE '"+ materno1+"%' ORDER BY [sis_persona].[Nombre], [sis_persona].[Paterno], [sis_persona].[Materno] LIMIT 20";
    And my ResultHandler is the next one:
        row = document.createElement("tr");
                    cell = document.createElement("th");
                    cell.innerText = "Nombre";
                    row.appendChild(cell)       
                    cell = document.createElement("th");
                    cell.innerText = "Paterno";
                    row.appendChild(cell)       
                    cell = document.createElement("th");
                    cell.innerText = "Materno";
                    row.appendChild(cell)       
                    tbl.appendChild(row);
                    var numRows = result.data.length;
                    for (var i = 0; i < numRows; i++)
                        // iterate over the columns in the result row object
                        row = document.createElement("tr");
                        for (col in result.data[i])
                var ea = result.data[i];
                cell = document.createElement("td");
                var a  = document.createElement( 'a' );
                a.setAttribute('HREF','#');
                var txt = document.createTextNode( ea.Nombre );
                a.appendChild( txt );
                a.onclick = function() {querytest(ea.idPersona);};
                row.appendChild( a );
                row.appendChild(cell);
                            cell = document.createElement("td");
                var a  = document.createElement( 'a' );
                a.setAttribute('HREF','#');
                var txt = document.createTextNode( ea.Paterno );
                a.appendChild( txt );
                a.onclick = function() {querytest(ea.idPersona);};
                row.appendChild( a );
                row.appendChild(cell);
                        cell = document.createElement("td");
                var a  = document.createElement( 'a' );
                a.setAttribute('HREF','#');
                var txt = document.createTextNode( ea.Materno );
                a.appendChild( txt );
                a.onclick = function() {querytest(ea.idPersona);};
                row.appendChild( a );
                row.appendChild(cell);
                        tbl.appendChild(row);
    And this is where i have the problem, it print three times and i dont know how to take print only the result and make a link with the id from the query.
    var ea = result.data[i];
                cell = document.createElement("td");
                var a  = document.createElement( 'a' );
                a.setAttribute('HREF','#');
                var txt = document.createTextNode( ea.Nombre );
                a.appendChild( txt );
                a.onclick = function() {querytest(ea.idPersona);};
                row.appendChild( a );
                row.appendChild(cell);
    Anyone have any ideas?
    Sorry again if my english is bad.
    Thanks in advance

    Hi Prashant,
    Continuation to above my thread. There is a small correction.Directly in lsmw not possible. I uploaded using the same code of lsmw and made one report. Through that i uploaded the data directly selecting the file.
    Regards,
    Madhu.

Maybe you are looking for

  • I am unable to burn a playlist in iTunes 10

    I try to burn a playlist from iTunes10 I keep getting a media read error and the disk appears to be half burned. I can create a burn folder on my desktop and burn the cd with no problems. This problem started two updates ago. I have tried using an ex

  • Recording audio from external keyboard

    Hello I have a keyboard hooked up to my computer via USB connection. I can record the keyboard to 'software instrument' track but can't to 'audio' track. I have a microphone also USB connection, I can record to 'audio' track, no problem, so Im not su

  • Cant down load itunes on windows 7

    cant download itunes after trying to update i have cleared all temp files and when i try to download it just says thanks with no option to save or warning

  • Installing InDesign CS4 upgrade from Pagemaker 7.0

    I have purchased InDesign CS4 upgrade from Pagemaker 7.0.  I have also purchased a new computer on which I have installed it. When I run CS4 it offers me a trial version or enter a serial number.  I entered my PM7 serial number but that doesn't work.

  • IDOC Mapping to Flat file

    Hi, I have a scenerio where in my Idoc has two segments as shown below. <b> E1PITYP</b>     <i> Z1P9008      E1P0021</i> E1PITYP - is the parent and the other two are child segements. I need to map both these segments into one single record. This is