1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Displaying data from mysql database.

Discussion in 'JSP' started by guravharsha, Jul 8, 2008.

  1. guravharsha

    guravharsha New Member

    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:
    like at above red color line
    can anybody have solution for above or any alternative code.
    Thanks and regards
  2. XXxxImmortalxxXX

    XXxxImmortalxxXX New Member

    well you are calling the method on an object (st) reference set to NULL doesnt make any sense to me
    that code is going to throw a NullPointerException.

Share This Page