You can download the simple running program from
http://jdbc.virtualave.net/jdbc/jdbcconnectivity.htm
----- Original Message -----
From: Parvez Lanewala <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 28, 2000 12:28 AM
Subject: new to JDBC !!!
> 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
>
___________________________________________________________________________
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