Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

myResultSet.beforeFirst()

 
m brymer
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to use the beforeFirst() method but keep getting an error message. Can someone take a look at my code and tell me what I may be missing?
Thanks!
 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It would help if you also cited which exception is thrown and identify the line that caused it. One common cause of error in your code is to call beforeFirst() on a forward-only ResultSet. This is defined when you create the Statement (Connection.createStatement(String, int, int)), and that is not explicit in your code. Check out ResultSet class description in Javadoc for more info and example.
 
m brymer
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error I am getting is "Method not yet supported"
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Apart from the Exception, will this not go into an indefinite loop??
[ May 02, 2005: Message edited by: Neeraj Dheer ]
 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by m brymer:
The error I am getting is "Method not yet supported"


It seems that your JDBC driver is some kind of beta version. Anyway, you should check your Statement instantiation; it should be something like this:

That would ensure that, by specification, rs.beforeFirst() would work under normal conditions. If it does not, then the exception is clear: the JDBC driver vendor did not implement this method yet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic