This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes myResultSet.beforeFirst() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "myResultSet.beforeFirst()" Watch "myResultSet.beforeFirst()" New topic
Author

myResultSet.beforeFirst()

m brymer
Ranch Hand

Joined: Jan 04, 2005
Posts: 64
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

Joined: Apr 29, 2004
Posts: 92
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.


Henrique Sousa<br />SCJP 1.4<br /> <br />All men die, not all men really live - Braveheart, 1995
m brymer
Ranch Hand

Joined: Jan 04, 2005
Posts: 64
The error I am getting is "Method not yet supported"
Neeraj Dheer
Ranch Hand

Joined: Mar 30, 2005
Posts: 225


Apart from the Exception, will this not go into an indefinite loop??
[ May 02, 2005: Message edited by: Neeraj Dheer ]
Henrique Sousa
Ranch Hand

Joined: Apr 29, 2004
Posts: 92
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: myResultSet.beforeFirst()
 
Similar Threads
JSF - SelectManyListBox doesnt populate on valeChangeevent
Storing resultset into arraylist
request.getParameter() returns a null value in the servlet
Using JSTL / EL to grab parameter names and values
String Comparison Problem.