Error in retriving data


Web tier: servlets, JSP, Web frameworks: Error in retriving data

  1. Error in retriving data (2 messages)

    I am able to get the connection throgh connection bean. i have also one bean to get all tables from the database. for that my bean name is GetAllColumns() but when i run the jsp page it shows me following error

    [Microsoft][ODBC Microsoft Access Driver]Invalid descriptor Index. on the command prompt of Tomcat Startup file
    So please suggest me to remove this error
    Thaks in adv


    Threaded Messages (2)

  2. Error in retriving data[ Go to top ]

    Looks like your are using MS ODBC-JDBC Driver. I remember it has limited capabilities in dealing with database metadata, which is probably what you are trying to retrieve. Try the same code with other database like MySQL
  3. Error in retriving data[ Go to top ]

    checked but it shows no driver found though my setting is ok..i put the connector.jar into tocmat_home/common/lib and put it into classpath

    pelse see the code and let me know

    i have errro in accessing data. I got the tablenames in Vector but things is that actually i have 3 tables but it shows 20 tables on the command prompt(may be prob. is in loop) and second thing is in the jsp page it shows nothing(in jsp page i have used Enumeration to display data)may be becoz of this it the jsp page it shows the status "opening page bean.jsp"in the status bar and after some time shows "disk cleanup message".

    Here is my code both and bean.jsp
    package development.connection;
    import java.beans.*;
    import java.sql.*;
    import java.util.*;

    public class DbConnection {

    /** Creates new DbConnection */
    public Connection getDbConnection() {
    con = DriverManager.getConnection(dbURL);

    }catch(ClassNotFoundException cls){
    System.out.println("No Proper Driver Class found for Connection \n");
    }catch(SQLException se){
    System.out.println("Error creating Connection");
    return con;

    public void setDbConnection(Connection setcon){
    con = setcon;

    /** get all columns number from the database */
    public Vector getAllColumns(){
    st = con.createStatement();
    rs = st.executeQuery(query);
    metadata = rs.getMetaData();
    columns = metadata.getColumnCount();

    for(int i=1;i<=columns;i++)
    }catch(SQLException ex){
    System.out.println("\nSQL EXCEPTION(Columns) ------------------\n");
    return vColumns;
    public void setAllColumns(Vector noColumns){
    vColumns = noColumns;

    /** Destroy the connection */
    public void destroyConnection(){
    if(con != null)
    con = null;
    }catch(SQLException ex){
    System.out.println("\nSQL EXCEPTION------------------\n");

    public Connection con= null;
    public Statement st = null;
    public ResultSet rs = null;
    public ResultSetMetaData metadata;
    public int columns;
    Object rsColumns;
    Vector vColumns = new Vector();
    public String dbURL = "jdbc:odbc:dsn";
    String query = "SELECT CompanyName FROM temp";
    and bean.jsp page

    <%@ page import="java.util.Vector"%>
    <%@ page import="java.util.Enumeration" %>

    <jsp:useBean id="connectBean"
    class="development.connection.DbConnection" scope="session" />
    <title>JSP BEAN EXAMPLE</title>
    <jsp:setProperty name="connectBean" property="dbConnection" />
    <%= connectBean.getDbConnection() %>
    <jsp:setProperty name="connectBean" property="allColumns" />
    <% Vector columnList = connectBean.getAllColumns();%>
    <% Enumeration vEnum = columnList.elements();
    <% out.println(vEnum.nextElement());%>

    please help me to sovle the prob.