Title: RE: Accessing a database via servlets

Hi Krishna,

Thanks for your reply. I had  changed the QUERY Statement in the mail to reflect NAME,PHONENUM. But if you see the Code that I  have attached you'll find it has USERID & PASSWORD as the fields to be retrieved. So the problem is not with the query statement. I seem to be missing someting else. Could you run this appln. on your machine and see if you are getting any memory error messages.

Note: I do get the list of userid,password on my screen. Something else is failing, say like the conn.close() statement....

TIA,
Ravi

    -----Original Message-----
    From:   kiran kumar nimashakavi [SMTP:[EMAIL PROTECTED]]
    Sent:   Monday, February 07, 2000 11:53 AM
    To:     [EMAIL PROTECTED]
    Subject:        Re: Accessing a database via servlets

    hi ravi

    u have used a wrong column name.. in the seslect query u have used�
    ���� rs = stmt.executeQuery("SELECT NAME,PHONENUM FROM SUBSCRIBERS");
    NAME adn PHONENUM but while ur�using userid and password� browsing the result set

    better use index number ....

    hope�ur problem is solved

    bye
    jaya krishna


    �while(rs.next())
    ����������������������� {
    ������������������������������� out.println("<LI>" + rs.getString("userid") + " " + rs.getString("password"));
    ����������������������� }

      ----- Original Message -----
      From: Gopalankutty, Ravi Kumar (CTS) <mailto:[EMAIL PROTECTED]>
      To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
      Sent: Monday, February 07, 2000 10:05 AM
      Subject: Accessing a database via servlets


      Hi list,

      I tried to implement Jason Hunter's example on a JDBC call to a database (Access in my case) and throw the resultant output via a servlet. Everything works fine but after showing the resultset on the browser the JVM comes up with a "memory read failed" error message. Has anyone experienced similar problems???

      I am enclosing the sample code I used. Before you check this out. Please create a DSN to an Access database with a table named subscribers having Name and PhoneNum as the field names.

      <<DBConnect.java>>

      Please do let me know if any of you are having this problem.

      Thanks k Regards

      Ravi Kumar Gopalankutty
      Cognizant Technology Solutions,
      Ph: 044-2354281 Extn:4423
      e-mail: [EMAIL PROTECTED]
      _______________________________________________________________


Reply via email to