• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

who is implementing ResultSet

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ResultSet is an interface, you have to implement the interface if u want to provide any implementaton to the methods, actually we are not implementing this interface,but calling the methods like next(), afterLast() etc. in our class. how it is possible.
Thanks in advance.
Srinivasa Rao
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You register a driver using Class.forName(...) (actually, that line allows the driver to register itself), then when you call DriverManager.getConnection(...), the DriverManager looks at the drivers it knows about and returns one that will handle the given database URL.
Everything from this point is done via interfaces. There are concrete classes behind these interfaces, but it is better to treat them as 'generic database classes' rather than the specific types because this makes your code independant of the specific database.
If you want to know what the actual class is, check System.out.println( rs.getClass().getName() );
DO NOT cast to this specific class! This ways leads to the dark-side of the Java
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The implementer of your JDBC classes (eg com.sybase.jdbc2.jdbc or sun.jdbc.odbc) implements ResultSet. The advantage of keeping the methods in the interface is that it frees the developer from being tied down to any specific implementation.
 
Srinivasa Rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks david and snigdha
i got the answer now.
Srinivasa Rao
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic