Regarding ResultSet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bsonline
    New Member
    • Oct 2007
    • 21

    Regarding ResultSet

    ResultSet is a Interface. So without implementing its method next(), we can use next() method in our appliaction directly.
    But according to the concept of a Interface how it is possible ?
    Can anyone help me regarding this?
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by bsonline
    ResultSet is a Interface. So without implementing its method next(), we can use next() method in our appliaction directly.
    But according to the concept of a Interface how it is possible ?
    Can anyone help me regarding this?
    Third party (who is providing the JDBC driver for the database) implements those methods.

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      To add to the previous reply: try the following code snippet with any ResultSet r:

      Code:
      ResultSet r= ...;
      System.out.println("class: "+r.getClass().getName());
      ... and see wich class really implements the ResultSet interface.

      kind regards,

      Jos
      Last edited by r035198x; Dec 15 '08, 09:31 AM. Reason: getgClass --> getClass

      Comment

      Working...