Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet's getXXX methods

 
eric moon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given that a result set knows the TYPE of each column of data, via ResultSetMetaData I'm wondering whether it's impossible or impractical to extend ResultSet and provide a get() method that is TYPE independent, and calls the appropriate getXXX based on the column's type (at least for those types that should be displayed as text.) If it is possible, what are the reasons for not supplying something like this in java.sql?? I'm tempted to try doing this, and am wondering if there is some huge pitfall I've overlooked!
[I just looked at ResultSet.getString() again and it sounds like maybe it already does this. I will try it and see.]
Thanks!
[This message has been edited by eric moon (edited December 16, 2000).]
 
paul sun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getObject() can do whatever type you want. Isn't it "independent"?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic