Results 1 to 3 of 3
  1. #1
    Haresh gurav is offline Member
    Join Date
    Jul 2008
    Rep Power

    Default Displaying data from mysql database.

    In main.jsp i wish to display the data from the database( user information stored in user table ). my codein main.jsp is:

    <h2> description about user:</h2>
    <% Statement st = null;
    ResultSet rs = null;

    rs = st.executeQuery("Select description from user ");
    <option value = "<%=rs.getString("description")%>" >
    when i run the above code it shows the error:
    org.apache.jsp.main_jsp._jspService( 72)
    like at abovered color line
    can anybody have solution for above or any alternative code.
    Thanks and regards

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    Define your statement and don't use scriptlets in JSP (they're only really still there for backwards compatability use a bean).

  3. #3
    Eku is offline Senior Member
    Join Date
    May 2008
    Makati, Philippines
    Rep Power


    where is your driver?
    where is the connection string? You dont even have a connection. ^_^

    And as masijade said, please avoid using scriptlets. You can also use Servlets ^_^
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

Similar Threads

  1. database with mysql using the netbeans 6.0
    By kwesiaryee in forum New To Java
    Replies: 2
    Last Post: 05-02-2008, 05:27 AM
  2. MySQL Database and Java
    By shaggymac in forum Advanced Java
    Replies: 1
    Last Post: 05-01-2008, 10:01 PM
  3. Help needed with updating mysql database
    By SilentCodingOne in forum New To Java
    Replies: 1
    Last Post: 12-11-2007, 11:23 PM
  4. connecting to mysql database
    By javagal in forum NetBeans
    Replies: 2
    Last Post: 08-04-2007, 01:36 PM
  5. Displaying different columns with database query
    By jennybgh in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 08-02-2007, 06:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts