hi,

i'm not getting why i'm getting this error.
can someone help me.

when i compile the following code :

// this is in init() function
.....
.....
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:data1");
Statement stmt=con.createStatement();
......
......
protected void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
ResultSet result;
if(req.getParameter("action").equals("publisher"))
{
result=stmt.executeQuery("Select * from BookDetails");
msg=result.getString(4);
}
...
...
...

This gives error as:
------------------------------------------------------------------
data1.java:59: Undefined variable or class name: stmt
result=stmt.executeQuery("Select * from BookDetails");
^
------------------------------------------------------------------
Where do i define result ?

Thanks.
Parvez.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to