Your problem i that you don't have any instance of the disBean class and you are trying to call one of its methods. This is only possible if you call an static method, but query() isn't one. So create an instance of disBean, before you use any of its methods. You can do it in to ways: Using the classic way: disBean dB = new disBean(...); Or the JSP way: <jsp:useBean id=" name" scope="page|request|session|application" typeSpec /> typeSpec ::=class=” className” | class=” className” type=” typeName” | type=” typeName” class=” className” | beanName=” beanName” type=” typeName” | type=” typeName” beanName=” beanName” | type=” typeName” Bye ----- Mensaje Original ----- De: Preeti <[EMAIL PROTECTED]> Fecha: Jueves, Febrero 22, 2001 9:03 pm Asunto: help me in showing the recordset > Hi guys > I have foloowing 2 file (a jsp file and a bean ) and want to show my > recordset(which contains multiple rows of data ) on my jsp page my > code is > showing me the following error pls help me out guys .. I'm very > new to JSP > this error is coming on my JSP page .. > The error is > > "Can't make static reference to method java.util.Vector query() in > classshop.disBean. > vect=disBean.query(); > ^ " > > and my JSp page is now : > > <%@ page language="java" import="java.util.*" %> > <%@ page import="shop.disBean"%> > <HTML> > <HEAD> > <TITLE> > Display Products > </TITLE> > </HEAD> > <BODY topmargin="0" leftmargin="0"> > <table cellspacing="2" cellpadding="2" border="1"> > <tr> > List of Products > <table border="3"> > <tr> > <td>Product Name</td> > <td>Price</td> > <td>Color</td> > <td>Brand</td> > <td>Category Name</td> > </tr> > > <% > Vector vect=new Vector(); > vect=disBean.query(); > int size=vect.size(); > > for(int i=0;i<size;i++) > { > > disBean dsp=vect.elementAt(i); > > %> > <tr> > <td><%= dsp.getProduct_name()%></td> > <td><%= dsp.getPrice()%></td> > <td><%= dsp.getColor() %></td> > <td><%= dsp.getBrand() %></td> > <td><%= dsp.getCategory_name() %></td> > </tr> > <% > } > %> > </table> > </td></tr></table> > </BODY> > </HTML> > > and my bean is : > > package shop; > > import java.sql.*; > > import java.util.Vector; > > > public class disBean { > private String product_name; > private int price; > private String color; > private String brand; > private String category_name; > String url = "jdbc:odbc:test"; > Connection conn; > Statement stmt; > public void setProduct_name(String pname) > { > this.product_name = pname; > } > > public String getProduct_name() > { > return product_name; > } > > public void setPrice(int prc) > { > this.price = prc; > } > > public int getPrice() > { > return price; > } > > public void setColor(String col) > { > this.color = col; > } > > public String getColor() > { > return color; > } > > public void setBrand(String brd) > { > this.brand = brd; > } > > public String getBrand() > { > return brand; > } > > public void setCategory_name(String catname) > { > this.category_name = catname; > } > > public String getCategory_name() > { > return category_name; > } > > > public String connect() > { > try { > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > return "Driver Loaded!"; > } > catch (Exception E) { > return "Unable to load driver."; > } > } > > public Vector query() throws SQLException, > ClassNotFoundException { > > try > { > conn = DriverManager.getConnection(url, "sa", ""); > stmt = conn.createStatement(); > String query = " select * from product p, category c where > p.category_id = c.category_id " ; > > ResultSet rs = stmt.executeQuery(query); > Vector res = new Vector(); > while (rs.next()) > { > disBean db = new disBean(); > > db.setProduct_name(rs.getString("product_name")); > db.setPrice(rs.getInt("price")); > db.setColor(rs.getString("color")); > db.setBrand(rs.getString("brand")); > > db.setCategory_name(rs.getString("category_name")); > res.addElement(db); > } > > stmt.close(); > conn.close(); > return res; > }//end of try > > catch (SQLException e) { > conn.close(); > throw e; > } > } > } > pls tell what is the problem > Thanks Preeti > > ======================================================================== === > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff > JSP-INTEREST". > For digest: mailto [EMAIL PROTECTED] with body: "set JSP- > INTEREST DIGEST". > Some relevant FAQs on JSP/Servlets can be found at: > > http://java.sun.com/products/jsp/faq.html > http://www.esperanto.org.nz/jsp/jspfaq.html > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets > ________________________________________________________________ Consigue tu cuenta gratuita de acceso a internet y de correo en http://www.navegalia.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets