Servlet to retrieve data

hello people,
this is the program i wrote to retrieve data from MSAccess but i do not get the output at all. just a blank page is thrown. can u help me?
Thanks in advance
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
* @author Arun_EV
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
public class DatabaseServlet extends HttpServlet {
     public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
          Connection con = getConnection();
          ResultSet rs = null;
          String sql = "select * from [empData]";
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          try
               Statement s = con.createStatement();
               rs = s.executeQuery(sql);
               while(rs.next())
                    int empnum = rs.getInt("Employee Number");
               out.print("<HTML><HEAD><TITLE>Testing My Servlets</TITLE></HTML><BODY><H1>E number is empnum</H1></BODY></HTML>");
          catch(SQLException e)
                                             System.out.println(e);
                                        catch(Exception e)
                                             System.out.println(e);
     * @return
     private Connection getConnection() {
          Connection con = null;
                    try
                         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;//getting the jdbc:odbc driver
                         con = (Connection) DriverManager.getConnection("jdbc:odbc:MyAccessDSN");//connecting to Excel DSN
                    catch(SQLException ex)
                         ex.printStackTrace();
                    catch (Exception ex)
                         ex.printStackTrace();
                         System.exit( 0 );
                    return con;
}

These values are from a form MStatus1.jsp which are
retrieved by a javabean named fileuploadbean:And you are sure those values are actually set? Besides, accessing fields by name strings strikes me as a little bit odd and un-OOish. But oh well..
The name strings are the names of the controls on the MStatus1.jsp file.
The controls are having their values from database which are no doubt visible on the MStatus1.jsp page.
on MStatus1.jsp page i have a button on whose click the servlet is called which uses fileuploadbean to retrieve the values from MStatus1.jsp page.
Message was edited by:
aarohan_jamwal

Similar Messages

  • Html- jsp- servlet to retrieve data from DB

    hi there, i'm a newbie of jsp programming and I'm trying to develop a simple application in order to retrieve some data from a database table. Then I want to display it.
    I read lots of examples but all of them used sql queries or java code into the jsp file. Actually I would like to respect the MVC structure as much as I can.
    The final thing shoul be like this:
    -type in a name into the search box implemented in the html file
    -the html file then calls the jsp wich get the typed in value and pass it to the servlet
    -the servlet which connects to DB and makes an SQL query using the typed in value, then send the result to the jsp
    -finally the jsp displays the result (in this case I'm trying to use displaytag (displaytag.sourceforge.net)).
    The code must still have to be checked for unuseful stuff but it compiles and this is enough by now.
    Here it is:
    cerca_agenzie.html
    <html>
      <head>
        <title>Cerca un'Agenzia</title>
      </head>
      <body bgcolor="white">
    <i>     Inserisci il nome dell'agenzia di cui si richiedono le informazioni o parte di esso e poi clicca sul pulsante "Cerca"</i>
        <form action="info_agenzie.jsp" method="get">
          <table>
              <td>Nome Agenzia:</td>
              <td><input type="text" name="cerca">
              </td>
            <tr>
              <td colspan=2><input type="submit" value="cerca"></td>
            </tr>
          </table>
        </form>
      </body>
    </html>
    info_agenzie.jsp
    <%@ page language="java" contentType="text/html" %>
    <%@ page import="andrea.*" %>
    <%@ page import="org.displaytag.sample.*" %>
    <%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
    <jsp:useBean id="agenzie" class="andrea.Sessione" />
    <jsp:setProperty name="agenzie" property="*" />
    <html>
      <head>
        <title>Risultato Della Ricerca</title>
      </head>
      <body bgcolor="white">
         Sono state trovate le seguenti agenzie:
          <p>
         <display:table name="agenzie" list="requestScope.risultato.rows" decorator="org.displaytag.sample.Wrapper" >
         <display:column property="Indirizzo" title="ID" />
         <display:column property="Telefono" />
         </display:table>
      </body>
    </html>
    Sessione.java
    /*=========================================================
    Sessione.java          
    si connette al DB e recupera le informazioni sulle agenzie
    ==========================================================*/
    package andrea;
    import org.apache.commons.beanutils.RowSetDynaClass;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Sessione extends HttpServlet {
    private String cerca;
    private RowSetDynaClass resultset;
    private RowSetDynaClass risultato;
    /*======================
    metodo getter del bean
    ======================*/
    public RowSetDynaClass getRisultato() {
         return risultato;
    /*======================
    metodo setter del bean
    ======================*/
    void setCerca(String cerca) {
            this.cerca = cerca;
    /*===========
      form get
    ============*/
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
         RowSetDynaClass risultato = connectToDB(cerca);
            req.setAttribute("risultato",risultato);
         String nextJSP = "/info_agenzie.jsp";
         RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
         dispatcher.forward(req,res);
    /*====================================================================================================
    doSelect restituisce: 1. tutti i dati di tutte le agenzie se la form viene lasciata vuota
                           2. tutti i dati dell'agenzia corrispondente al valore del campo descrizione
    =====================================================================================================*/
    public ResultSet doSelect(Statement st, String s) {
         ResultSet rs = null;
         if (s == "") {
              try {
                   rs = st.executeQuery("SELECT * FROM agenzie ORDER BY descrizione");
              catch (SQLException e) {
                   System.out.println(e);
         else {
              try {
                   rs = st.executeQuery("SELECT * FROM agenzie WHERE descrizione LIKE %\""+s+"\"% ORDER BY
    descrizione");
              catch (SQLException e) {
                   System.out.println(e);
         return rs;
    /*=============================================================
    connectToDB esegue la doSelect e invia il risultato alla jsp
    ==============================================================*/
    public RowSetDynaClass connectToDB(String sel) {
         Connection conn = null;
         ResultSet rs=null;
         try {
              Class.forName("com.mysql.jdbc.Driver"); //carica il driver per MYSQL
              conn = DriverManager.getConnection("jdbc:mysql://82.51.248.50/progestimm?user=root&password=ak47posse");
    //log in al database
              Statement stmt = conn.createStatement(); //necessario per fare le query
              rs = doSelect(stmt,sel);
              resultset = new RowSetDynaClass(rs, false);
              try {
                   rs.close(); }
              catch(SQLException e) {
                   System.out.println(e); }
         catch (ClassNotFoundException e) {
               System.out.println(e);
         catch (SQLException e) {
              System.out.println(e);
         finally {
              try {
                   if (conn != null) conn.close();
              catch (SQLException e) {
                   System.out.println(e);
         return resultset;
    }Thanks in advance for your kindness,
    Andrea

    These values are from a form MStatus1.jsp which are
    retrieved by a javabean named fileuploadbean:And you are sure those values are actually set? Besides, accessing fields by name strings strikes me as a little bit odd and un-OOish. But oh well..
    The name strings are the names of the controls on the MStatus1.jsp file.
    The controls are having their values from database which are no doubt visible on the MStatus1.jsp page.
    on MStatus1.jsp page i have a button on whose click the servlet is called which uses fileuploadbean to retrieve the values from MStatus1.jsp page.
    Message was edited by:
    aarohan_jamwal

  • 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

  • Error :Unable to retrieve data from iHTML servlet for Request2 request

    I open bqyfile to use HTML in workspace.
    When I export report to excel in IR report.
    Then I press "back" button I get error"Unable to retrieve data from iHTML servlet for Request2 request "
    And I can not open any bqyfiles in workspace.
    Anybody gat the same question? Thanks~

    Hi,
    This link will be helpful, the changes is made in the TCP/IP parameter in the registry editor of Windwos machine. I tried the 32 bit setting for my 64 bit machine (DWORD..) and it worked fine for me..
    http://timtows-hyperion-blog.blogspot.com/2007/12/essbase-api-error-fix-geeky.html
    Hope this helps..

  • Failed to retrieve data from the database when adding jdbc datasource

    I'm having problems adding some tables to the selected tables list using the database expert.
    I get the error messages "Failed to retrieve data from the database" followed by "Unknown Database Connection Error".
    I thought it may be a permissions issue as it only affects some tables, but I can access the same tables fine using the same user through Oracle SQL Developer.
    The database is Oracle 10g Express Editions
    Crystal version is 12.0.0.683
    Running on Windows XP
    Any suggestions would be much appreciated.

    Hi Stuart
    Please refer SAP note 1218714 for this issue. The link to this article ia as follows:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333733313334%7D.do
    You can search for this note on the SDN site.
    Hope this helps.
    Thanks!

  • Retrieve data from R3 to XI using RFC

    Hi,
    I want to get data out from R3 to XI through RFCs or even using idocs. I have done RFC configurations in abap using SM59 with XI as destination. I am not sure whether its right. Please guide me as to how to get data out of R3 by first sending the ID no. to R3 and then retrieving data. Can anybody help me or give me some links where i could get some information about such a scenario?
    Thank you

    Hi Kevin,
    You need not to do any seeting at R3 side for RFC Scenarios.
    For RFC Scenario:
    Make RFC in R3 make sure that it is working fine in R3. take ID as a import parameter.
    Import the RFC Structure in XI in Imported Objects.
    Do the Design & Configuration as you do generaly.
    For IDOC Scenarios :
    Yuo have to do some setting in R3 and XI side . For Required setting refer following Links.
    Trouble shooting ALE settings.
    Troubleshooting of ALE Process
    Configuration steps for Idoc.
    Configuration steps required for posting idoc's(XI)
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d19fe210-0d01-0010-4094-a6fba344e098
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cdded790-0201-0010-6db8-beb9bb2b2660
    Reward Points if Helpful
    Thanks
    Sunil Singh

  • Error message-retrieve data from database

    I tried to retrieve data from oracle database. I got the following error message. I did compile the files without error. but when I run index.jsp I got the following error message. is it related with taglib Directives ?
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:8
    5: <% AccessDB accessDB=new AccessDB(); %>
    6:
    7: <%-- create an instance of List, then retrieve SubjectNames --%>
    8: <% List subjNames=accessDB.getSubjectName(); %>
    9:
    10: <%-- make list accessible to page --%>
    11: <% request.setAttribute("subjNames", subjNames); %>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    java.lang.NullPointerException
         org.AccessDB.getSubjectName(AccessDB.java:68)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    Apache Tomcat/5.5.17

    Hi,
    Try to print the value in List...n comment the request.setAttribute...n then run the program....
    check wot value is printed in List....
    This error may b because the List doesnt have anyvalue into it.....

  • Try to retrieve data from database got error message

    Try to retrieve data from database got error message *"java.lang.ArrayIndexOutOfBoundsException: 2*
    *     sun.jdbc.odbc.JdbcOdbcPreparedStatement.clearParameter(JdbcOdbcPreparedStatement.java:1023)*
    *     sun.jdbc.odbc.JdbcOdbcPreparedStatement.setDate(JdbcOdbcPreparedStatement.java:811)*
    *     guestbk.doGet(guestbk.java:32)*
    *     guestbk.doPost(guestbk.java:73)*
    *     javax.servlet.http.HttpServlet.service(HttpServlet.java:710)*
    *     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)"*
    I have used prepared statment
    java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd/MM/yy");
                java.util.Date dt = sdf.parse(str3);
                       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                       con=DriverManager.getConnection("jdbc:odbc:gbook");
                       //Statement stmt=con.createStatement();
    PreparedStatement ps = con.prepareStatement("SELECT * from gbook where emailid =? AND date =?");
    ps.setString(1,str1);
    ps.setString(2,str2);
    ps.setDate(3,new java.sql.Date(dt.getTime()));
    //ps.executeQuery();
                       //ResultSet rs=stmt.executeQuery("select * from gbook where emailid = str1");
                  ResultSet rs = ps.executeQuery();
                       out.println("<Html>");
                    out.println("<Head>");
                       out.println("<Title>GuestBook</Title>");
                       out.println("</Head>");
                       out.println("<Table border=1 align=center >");
                       out.println("<H4><B><center>Teacher's Lesson Plan</center></B></H4><BR>");
                       out.println("<TR><TD><b>Teacher Name</b></TD><TD><b>Class</b></TD></TR>");
               while(rs.next())
                        ctr++;
                        String email=rs.getString("emailid");
                        String cmt=rs.getString("comment");
                        out.println("<TR><TD>"+email+"</TD><TD>"+cmt+"</TD></TR>");
            }Please anybody help .

    PreparedStatement ps = con.prepareStatement("SELECT * from gbook where emailid =? AND date =?");
    ps.setString(1,str1);
    ps.setString(2,str2);
    ps.setDate(3,new java.sql.Date(dt.getTime()));Your SQL query has 2 placeholders but you try to set 3 values.
    And didn't you read the stack trace?
    guestbk.doGet(guestbk.java:32)You could've tracked down line 32 and seen what was there at that line.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    ----------------------------------------------------------------

  • Retrieve data from oracle table, table name passed in runtime into JSP

    Hello All,
    I am new to JSP, i have a requirement,
    I need to retrieve data from oracle table, here table is passed at random. how to get the data displayed in JSP page.
    can any one help me in that
    thanks

    1) Learn SQL.
    2) Learn Java.
    3) Learn JDBC.
    4) Learn DAO.
    5) Learn HTTP.
    6) Learn HTML.
    7) Learn JSP/Servlet.
    8) Learn JSTL.
    9) Apply learned things and develop.
    Whenever you stucks, please come back and post the specific coding/technical problem here.

  • How to increase speed while retrieving data from tableand showing it in pop

    Hi,
    In one form ,I have used f9 key to retrieve data from table in oracle database . i.e. in any input field in my form, once I press f9 key, it execute JavaScript windows. Open command.
    In that command, I called the servlet which retrieves nearly 7000 rows data from table and then it dispatch request to another jsp page which shows the related data in tabular form. The data may contain nearly 7000-8000 rows.
    So when I press the f9 keys it takes around 10-12 second to open the page.
    Is there any ways to open this pop up windows within 2-3 second once I hit the f9 keys.
    Here with I am attaching hole code for servlet and jsp page.
    Any suggestion is highly appreciated.
    Thanks and Regards
    Harshal
      try {            Class.forName("oracle.jdbc.OracleDriver");            connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:bmltest","system","manager");            st = connection.createStatement(); String query = ""; if(find == null){ query = "SELECT A1.ITEMNAME,A1.TECHDESC, A1.ITEMCODE,SUBSTR(A1.MUNITCODE,1,3),A1.MUNITCODE FROM CMSTITEM A1,CMSTITEMGRP A2  WHERE A1.ITEMGROUPCODE=A2.ITEMGROUPCODE AND A2.ITEMCLASS='"+Iclasscode+"' ORDER BY A1.ITEMNAME ASC"; }else{ find = find.toUpperCase(); query = "SELECT A1.ITEMNAME,A1.TECHDESC, A1.ITEMCODE,SUBSTR(A1.MUNITCODE,1,3),A1.MUNITCODE FROM CMSTITEM A1,CMSTITEMGRP A2  WHERE A1.ITEMGROUPCODE=A2.ITEMGROUPCODE AND A2.ITEMCLASS='"+Iclasscode+"' ORDER BY A1.ITEMNAME ASC and A1.ITEMNAME like '%"+find+"%' OR A1.ITEMCODE like '%"+find+"%'"; } rs = st.executeQuery(query); while (rs.next()){ for (int i=1;i<=5;i++){ Itemnamedetail.add(rs.getString(i)); } } connection.close(); }catch(Exception e){ e.printStackTrace(); }                request.setAttribute("rowid",rowid); request.setAttribute("select",Itemnamedetail); RequestDispatcher view = request.getRequestDispatcher("Itemname.jsp"); view.forward(request,response); 
    and here is an jsp code
    <%@page import ="java.util.*,java.sql.*,java.text.*"%><% ArrayList<String> arr1 = (ArrayList<String>)request.getAttribute("select"); String rowid = (String)request.getAttribute("rowid"); String itmcd = "itmcd"+rowid;        String itmnm = "itmnm"+rowid;        String uom = "uom"+rowid;        String mcode = "mcode"+rowid;%>  <html><head> </head><body>  <form name = "unitsel" action = "SelectUnit" method = post><p align="center"><b>Find :    <input type = "text" id = "find" name = "find" ></p></form><table border = 2px align = "center" width = 75%> <tr> <th>Item Name</th> <th>Tech-Description</th>                <th>Item-code</th> <th>Unit-name</th>                <th>Munit-code</th> </tr> <td width = 65%><h5 align=center><%=b%></h5></td>                <td width = 35%><h5 align=center><%=c%></h5></td> <td width = 35%><h5 align=center><%=d%></h5></td> <td width = 65%><h5 align=center><%=e%></h5></td> </tr> <%j++;}%> </table> </body></html> 

    First of all you will have to apply paging to show data in tables. and retrieve only those sets of data which are required. You will defnitely need to do lot of code for that. but i am hopeful, you will get some thing on net.
    Second thing you can do is use AJAX. It will show your popup and will keep on loading data simultaneously. You can use JQuery and many others for that.

  • Can not retrieve data in Crystal Report

    Hi,
    I have a problem to load data from <i><b>Crystal Report</b></i> in an SBO form with the ActiveX DI object : the Crystal Report Viewer message display : <b><i>'Failed to retrieve data from the database. Details [Database Vendor Code:208]'</i></b>
    It seems do not change the name of database in SQL Crystal Report query : My SQL query in Crystal Report file is a generic query : it must run with all custom database with the same datatable ; so the database name in FROM  clause must be change with the SetLogonInfo : but it do not run !
    Have you an idea ?
    Francis
    Here my code :
    Public Class frm_CRViewer
    ' Adding References of project : CRAXDRT and CrystalActiveXReportViewerLib11
    Private WithEvents MRO_CRV As
    CrystalActiveXReportViewerLib11.CrystalActiveXReportViewer
    Public Sub New()
    Dim msa_Form As SAPbouiCOM.Form
    Dim dsa_ActiveX As SAPbouiCOM.ActiveX ' Item <ActiveX> from form XML
    dsa_ActiveX = msa_Form.Items.Item("axCRV").Specific()
    dsa_ActiveX.ClassID = "CrystalReports11.ActiveXReportViewer.1"
    MRO_CRV = dsa_ActiveX.Object
    ' Create the crystal application
    Dim dob_ReportApp As New CRAXDRT.Application
    ' Open the report
    Dim dob_Report As New CRAXDRT.Report
    dob_Report = dob_ReportApp.OpenReport("c:MyTest.rpt")
    ' Defined to log on to the data source, and change the database name in FROM clause
    Dim dob_Table As CRAXDRT.DatabaseTable
    For Each dob_Table In dob_Report.Database.Tables
         dob_Table.SetLogOnInfo("192.168.2.10", "AeroOneDemo", "sa", "45dfrfg5")
    Next
    ' The report have a parameter in the sql query
    dob_Report.ParameterFields.Item(1).DiscreteOrRangeKind = CRAXDRT.CRDiscreteOrRangeKind.crDiscreteValue
    dob_Report.ParameterFields.Item(1).AddCurrentValue("15")
    ' Display the report in SBO form
    Title = pst_ReportName
    MRO_CRV.ReportSource = dob_Report
    MRO_CRV.ViewReport()
    End Sub
    End Class

    Try these ...
    <a href="http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2002650&sliceId=&dialogID=7002531&stateId=1%200%207004328">http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2002650&sliceId=&dialogID=7002531&stateId=1%200%207004328</a>
    or
    <a href="http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2000957&sliceId=&dialogID=7002728&stateId=1%200%207004460">http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2000957&sliceId=&dialogID=7002728&stateId=1%200%207004460</a>
    or
    <a href="http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2001075&sliceId=&dialogID=7002728&stateId=1%200%207004460">http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2001075&sliceId=&dialogID=7002728&stateId=1%200%207004460</a>
    or
    [url=http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2003637&sliceId=&dialogID=7002728&stateId=1%200%207004460]http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2003637&sliceId=&dialogID=7002728&stateId=1%200%207004460[/url]

  • Can we retrieve Data of Single Dimension in multiplecolumns in Excel Add-in

    Hi All,
    I have strange requirement of having single dimension in two columns while retrieving data from essbase using Excel Add-In.
    Logically I feel it is not possible however we are looking if there is any possibilty of work arround for this requirement.
    Whenevr i am trying to retrieve data using a macro on a single column we are able to successfully do it. But in case of multiple columns we are unable to do it.Do let us know if there is any work arround or alternative method to handle this requirement.
    Regards,
    Krishna

    Not completely sure what you mean by "single dimension in two columns". Normally this request comes down to wanting to show multiple levels from a dimension, e.g...
    _______________"Sales"
    "100" "100-10" 12345
    "100" "100-20" 34567...which is definitely not possible.
    If you just mean data like this (with multiple columns from the same dimension)...
    ________"100-10"   "100-20"
    "Sales"  12345      34567...then that should work fine.
    If you could post a sample of what you'd like to see, it would be easier to answer.

  • Unable to install SQL Server Express 2008 R2 - Errors "Failed to retrieve data for this request"

    As domain admin I am attempting to install "SQL Server 2008 R2 with SP2" but it keeps failing with "Failed to retrieve data for this request".
    The installation never actually starts, it errors before then.
    It displays the same error even if I run the System Configuration Checker.
    The summary.txt for the install displays the following text:
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -1554760125
      Exit facility code:            852
      Exit error code:               15939
      Exit message:                  Failed to retrieve data for this request.
      Start time:                    2014-08-15 16:49:52
      End time:                      2014-08-15 16:50:06
      Requested action:              RunRules
    Machine Properties:
      Machine name:                  servername
      Machine processor count:       8
      OS version:                    Windows Server 2008 R2
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  Yes
    Product features discovered:
      Product              Instance             Instance ID                   
    Feature                                  Language            
    Edition              Version         Clustered
    Package properties:
      Description:                   SQL Server Database Services 2008 R2
      ProductName:                   SQL Server 2008 R2
      Type:                          RTM
      Version:                       10
      SPLevel:                       1
      Installation location:         c:\84122ef5b6d9cdcd3b2ac48cec\x64\setup\
      Installation edition:          EXPRESS
    User Input Settings:
      ACTION:                        RunRules
      CONFIGURATIONFILE:             
      ENU:                           True
      FARMACCOUNT:                   <empty>
      FARMADMINPORT:                 0
      FARMPASSWORD:                  *****
      FEATURES:                      
      HELP:                          False
      INDICATEPROGRESS:              False
      INSTANCENAME:                  <empty>
      PASSPHRASE:                    *****
      QUIET:                         False
      QUIETSIMPLE:                   False
      RULES:                         GLOBALRULES,SqlUnsupportedProductBlocker,PerfMonCounterNotCorruptedCheck,Bids2008InstalledCheck,BlockInstallSxS,AclPermissionsFacet,FacetDomainControllerCheck,SSMS_IsInternetConnected,FacetWOW64PlatformCheck,FacetPowerShellCheck
      UIMODE:                        AutoAdvance
      X86:                           False
      Configuration file:            C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20140815_164944\ConfigurationFile.ini
    Detailed results:
    Rules with failures:
    Global rules:
    There are no scenario-specific rules.
    Rules report file:               The rule result report file is not available.
    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented
    Exception type: Microsoft.SqlServer.Management.Sdk.Sfc.EnumeratorException
        Message:
            Failed to retrieve data for this request.
        Data:
          HelpLink.ProdName = Microsoft SQL Server
          HelpLink.BaseHelpUrl = http://go.microsoft.com/fwlink
          HelpLink.LinkId = 20476
          DisableWatson = true
        Stack:
            at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.ProcessDTbl(DataTable dt, Int32 level)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.CollectSqlDiscoveryData(String machineName)
            at Microsoft.SqlServer.Chainer.Infrastructure.SqlDiscoveryDatastoreInterface.LoadData(IEnumerable`1 machineNames, String discoveryDocRootPath, String clusterDiscoveryDocRootPath)
            at Microsoft.SqlServer.Configuration.SetupExtension.RunDiscoveryAction.ExecuteAction(String actionId)
            at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun)
        Inner exception type: Microsoft.SqlServer.Configuration.Sco.SqlRegistryException
            Message:
                    The network path was not found.
            Data:
              WatsonData = [email protected]rror
            Stack:
                    at Microsoft.SqlServer.Configuration.Sco.SqlRegistry.CreateBaseKey(ServiceContainer ctx, String machineName, IntPtr hKey, String keyName, RegistryAccess access, RegistryView
    view)
                    at Microsoft.SqlServer.Configuration.Sco.SqlRegistry.GetLocalMachine(ServiceContainer ctx, String machineName, RegistryAccess access, RegistryView view)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.GetSql2kMsiInstanceListInHive(String machineName, RegistryView regView)
                    at Microsoft.SqlServer.Discovery.DiscoveryEnumObject.LoadSql2kInstanceList(String machineName)
                    at Microsoft.SqlServer.Discovery.Product.GetData(EnumResult erParent)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData()
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request)
                    at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request)

        Inner exception type: Microsoft.SqlServer.Configuration.Sco.SqlRegistryException
            Message:
                    The network path was not found.
            Data:
              WatsonData = [email protected]rror
    Above message says that your registry is not consistent and some of the parameters are missing from registry.Or
    Account installing SQL server does not have permission to access this. I think case can be here that account with which you logged into your system to install SQL Server might not have certain privileges. Can you take help
    of domain admin account add it as a local administrator in this machine always right click on setup file and select run as administrator. Before this make sure you  remove all SQL Server components from add remove program
    I strongly recommend you to have a good look at below thread
    http://support.microsoft.com/kb/2000257/en-us
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Error while trying to retrieve data from BW BEx query

    The following error is coming while trying to retrieve data from BW BEx query (on ODS) when the Characters are more than 50.
    In BEx report there is a limitation but is it also a limitation in Webi report.
    Is there any other solution for this scenario where it is possible to retrieve more than 50 Characters?
    A database error occured. The database error text is: The MDX query SELECT  { [Measures].[3OD1RJNV2ZXI7XOC4CY9VXLZI], [Measures].[3P71KBWTVNGY9JTZP9FTP6RZ4], [Measures].[3OEAEUW2WTYJRE2TOD6IOFJF4] }  ON COLUMNS , NON EMPTY CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( [ZHOST_ID2].[LEVEL01].MEMBERS, [ZHOST_ID3].[LEVEL01].MEMBERS ), [ZHOST_ID1].[LEVEL01].MEMBERS ), [ZREVENDDT__0CALDAY].[LEVEL01].MEMBERS ) ........................................................ failed to execute with the error Invalid MDX command with UNSUPPORTED: > 50 CHARACT.. (WIS 10901)

    Hi,
    That warning / error message will be coming from the MDX interface on the BW server.  It does not originate from BOBJ.
    This question would be better asked to support component BW-BEX-OT-MDX
    Similar discussion can be found using search: Limitation of Number of Objects used in Webi with SAP BW Universe as Source
    Regards,
    Henry

  • Any way to use OBDC in SAP to access MySQL DB and retrieve data

    I'd like to logon to an external MySQL DB (can de done easily enough with PHP)   but I'd like to do it with ABAP if possible.
    Connecting via OBDC I should be able to retreive the data from the DB  and then use it in my SAP application.
    Some databases will allow connection via
    EXEC SQL.
    connect to :dbsid
      ENDEXEC.
    EXEC SQL.
        set connection :dbsid
      ENDEXEC.
    EXEC SQL.
      open xxxxxxx for
      select
    ...... data from external DB
    from tablespace in external db
    ENDEXEC.
    do.
      EXEC SQL.
        fetch next XXXXXX into
               :db_table_field, .... etc
                 ENDEXEC.
      if sy-subrc ne 0.
        exit.
      endif.
      insert table int_sap_table.
    enddo.
    EXEC SQL.
      close XXXXXX
    ENDEXEC.
    If you can make this type of stuff work for a MySQL DB i'd appreciate the answer.
    Using PHP has a drawback as you need to have it installed on the front end PC and run in Foreground.
    The EXEC SQL commands run in batch which is what you need if you are talking about 100,000's of records from an external DB.
    Cheers
    jimbo

    Hi Graham
    Currently it doesn't seem to support MySQL.
    Now that SAP has taken over again the development of MAXDB I can't see it providing  direct MySQL to SAP functionality.
    MAXDB is available but that would mean changing the entire architecture and we don't want to do that.
    I think probably the best route to go would be to create a BAPI which is capable of performing a logon to the remote  MySQL DB server, get the data and either send it back as  IDOCS, an external flat file, or as an internal table depending on the volume of data to be retrieved.
    The good thing about MySQL is that the command line interface makes logging on and retrieving data quite simple.
    This data is actually wanted in a BI  / BW system to provide for a number of business proces analyses.
    I did think abut using "Web Services"  but the data retrieval will essentially be done offline.
    There is no requirement currently for transferring data FROM SAP back to the MySQL database ( although if you've ever dealt with top level management you know how quickly developments can change).
    PHP for all it's drawbacks is the really easy way - but we'll have a problem doing this in background from the SAP servers. For foreground tasks it's a real doddle if you have php on your front end.
    for example
    <?php
    $username = "pee_wee";
    $password = "let_me_in";
    $hostname = "localhost";        */* IP address of remote DB server */*
    $dbh = mysql_connect($hostname, $username, $password)
    or die("Unable to connect to MySQL");
    print "Connected to MySQL<br>";
    // you're going to do lots more here soon
    mysql_close($dbh);
    ?>
    Batch mode also seems OK  also from the documentation
    http://dev.mysql.com/doc/refman/5.1/en/batch-mode.html
    so running an ABAP which can issue system commands (readily available) should work in theory provided the SAP server can connect to the remote MySQL server machine.
    Thanks for your suggestions however
    Cheers
    jimbo

Maybe you are looking for