How to store DB value into a Variable ???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akshay01
    New Member
    • May 2008
    • 12

    How to store DB value into a Variable ???

    Hi all,
    Does anyone know how to store the value retrieved from
    Code:
     PreparedStatement preparedstatement=connection.prepareStatement("select MAX(TOKEN_ID)from DB_TEMP");
    into a variable, so that i can use it in my jsp code??


    Thanks in Advance!
    Akshay
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by akshay01
    Hi all,
    Does anyone know how to store the value retrieved from
    Code:
     PreparedStatement preparedstatement=connection.prepareStatement("select MAX(TOKEN_ID)from DB_TEMP");
    into a variable, so that i can use it in my jsp code??


    Thanks in Advance!
    Akshay
    Execute the statement and get the ResultSet. The most important thing is:
    read the JDBC API documentation; it's all in there.

    kind regards,

    Jos

    Comment

    • BigDaddyLH
      Recognized Expert Top Contributor
      • Dec 2007
      • 1216

      #3
      A couple handy links:

      Sun's J2SE tutorials: http://java.sun.com/docs/books/tutorial/
      ... including JDBC tutorial: http://java.sun.com/docs/books/tutorial/jdbc/index.html
      Java documentation, including java.sql: http://java.sun.com/javase/6/docs/api/

      Comment

      Working...