Reputation:
I use .next() in java string to return the value what comes before white_space
e.g. "hello world"=> returns "hello"
But in jdbc:
ResultSet rs= stmt.executeQuery();
if(rs.next()){
//do something
}
I use it with the moto
"If the result set still has results, move to the next result and do something"
So I'm confused with the role. Please someone clarify it.
Upvotes: 0
Views: 88
Reputation: 29710
All standard Java classes are documented: Java API Specification.
Example:
Moves the cursor forward one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.
...
Finds and returns the next complete token from this scanner. A complete token is preceded and followed by input that matches the delimiter pattern.
...
Upvotes: 2