JDBC doesn't provide an EOF method.

JDBC doesn't provide an EOF method.

How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method?

View Answers

November 15, 2010 at 10:54 AM

Hi friends,

You can solve this problem of different method of ResultSet class. It is present in java.sql.ResultSet package.

Answer1 :- With the help of last() method of ResultSet class you can reach end of the current result set. If your result set is scrollable.

Answer 2:- You can also use isLast() as you are reading ResultSet.

One thing to keep in mind, though, is that both methods tell you that you have reached the end of the current ResultSet, not necessarily the end of the table. SQL and RDBMSes make no guarantees about the order of rows, even from sequential SELECTs, unless you specifically use ORDER BY. Even then, that doesn't necessarily tell you the order of data in the table.

Thanks.









Related Tutorials/Questions & Answers:
JDBC doesn't provide an EOF method.
JDBC doesn't provide an EOF method.  How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method
JDBC Batch executeBatch() Method Example
JDBC Batch executeBatch() Method Example: In this example, we can evaluate executebatch() method of the jdbc batch processing. The executebatch() method...;    "jdbc:mysql://localhost:3306/roseindia_jdbc
Advertisements
JDBC Batch commit method Example
JDBC Batch commit method Example: In this example, you can learn what is setAutoCommit() method and commit() method in the jdbc batch processing and how it work?. The setAutoCommit() method used to set created connection auto commit
ModuleNotFoundError: No module named 'bam_add_eof'
ModuleNotFoundError: No module named 'bam_add_eof'  Hi, My Python... 'bam_add_eof' How to remove the ModuleNotFoundError: No module named 'bam_add_eof' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'bam_add_eof'
ModuleNotFoundError: No module named 'bam_add_eof'  Hi, My Python... 'bam_add_eof' How to remove the ModuleNotFoundError: No module named 'bam_add_eof' error? Thanks   Hi, In your python environment
Sun's JDBC-ODBC driver does not implement the getPrimaryKeys() method for the DatabaseMetaData Objects.
Sun's JDBC-ODBC driver does not implement the getPrimaryKeys() method...) for an Access Database table? Sun's JDBC-ODBC driver does not implement the getPrimaryKeys() method for the DatabaseMetaData Objects
String fromCharCode() method example in Action Script3
.style1 { font-size: medium; } String fromCharCode() method example in Action Script3:- String provide a method to find characters by the character code using fromCharCode() method. we have define a string using this method
profile doesn't match application identifier
profile doesn't match application identifier  profile doesn't match application identifier
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'jpa.sequence' doesn't exist
' doesn't exist  Hi, I am developing an application using JPA 2.1... 'jpa.sequence' doesn't exist Error Code: 1146 Call: UPDATE SEQUENCE SET SEQ...] java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
method
method  can you tell me how to write an abstract method called ucapan() for B2 class class A2{ void hello(){ system.out.println("hello from A2"); }} class B2 extends A2{ void hello(){ system.out.println("hello from B2
jdbc
jdbc  is it possible to use doget & dopost method with jdbc to call in a servlet programe
A method getColumnCount.
A method getColumnCount.  There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set
NoughtsAndCrossesGame play button doesn't work
NoughtsAndCrossesGame play button doesn't work   /* * To change this template, choose Tools | Templates * and open the template in the editor...(); // Set some JFrame details // NOTE - In grid layout you provide
NoughtsAndCrossesGame play button doesn't work
NoughtsAndCrossesGame play button doesn't work   /* * To change this template, choose Tools | Templates * and open the template in the editor...(); // Set some JFrame details // NOTE - In grid layout you provide
Why doesn't Java allow overriding of static methods?
Why doesn't Java allow overriding of static methods?  Why doesn't Java allow overriding of static methods
SEEKING THE POSTION OF EOF
Spring JDBC Introduction
Spring JDBC Introduction The Spring's DAO(Data access object) make it easy for us to use data access technologies like JDBC, Hibernate, JPA or JDO... catching exception that are related to each technology. This tutorial provide
SQL select statement doesn't return any rows,
SQL select statement doesn't return any rows,  When an SQL select statement doesn't return any rows, is an SQLException thrown
ModuleNotFoundError: No module named 'provide'
ModuleNotFoundError: No module named 'provide'  Hi, My Python... 'provide' How to remove the ModuleNotFoundError: No module named 'provide... to install padas library. You can install provide python with following command
please provide the code
please provide the code   Develop a multi-client chat application
Please provide the code
Please provide the code   Write a program to recursively download the web pages available in the given site URL
why set doesn't allow duplicate value
why set doesn't allow duplicate value  HI Everyone Any one can help me why set not allowed duplicate value in java. Please post ur comment, its urgent. Thanks in advance
jdbc
jdbc  i had written jdbc connection in method and i need to get connection in another class?   import java.sql.*; class... driver = "com.mysql.jdbc.Driver"; String url = "jdbc:mysql://localhost:3306/test
jdbc
the Connection.setTransactionIsolation(int level) method isolation level can be set in JDBC. the method can
jdbc
a connection is created by using the JDBC, then by default it is in auto- commit mode... mode by using the method: con.setAutoCommit(false). After setting the auto...() method. If there arises any problem while committing then the set
Please provide the code
Please provide the code   Program to find depth of the file in a directory and list all files those are having more number of parent directories
jdbc
level: Using the Connection.setTransactionIsolation(int level) method isolation level can be set in JDBC. the method can accept any of the arguments listed below... work done after the savepoint. A save point is created using the method
Provide the code please
Provide the code please   Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
Please provide the code
Please provide the code   Create a file system: We just have one file on the hard disk. But we can create directories, sub-directories and files in that file only
Method
Method       In this section, we will explore the concept of method in the reference of object oriented... and behaviors are defined by methods. Method : An brief introduction Methods
Please provide the coding for this problem
Please provide the coding for this problem  Please provide the coding for the following problem. Write a "hangman" game that randomly generates a word and prompts the user to guess one letter at a time. Each letter in the word
hello .. still doesn't run - Java Beginners
hello .. still doesn't run  Iam still having a prblem in running... Scanner another error is can not resolve symbol method setname(java.lang.String... the method of Scanner coz i need to read integers numbers or any other kind
provide source - Java Beginners
provide source  please provide code for this program Write a program to download a website from a given URL. It must download all the pages from that website. It should take the depth of retrieval from the user input. All
JDBC
JDBC  why we use batch in jdbc
jdbc
jdbc  display the records using index in jdbc
jdbc
jdbc  Hai , Give a steps for jdbc connectivity
provide me the program for that ques.
provide me the program for that ques.  wtite a program in java there is a class readchar.the functionality of this class is to read a string from the console and display the characters of that string on the console.   
MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist
MySQL issue: Table 'data_dictionary.CHARACTER_SETS' doesn't exist  MySQL issue: Table 'datadictionary.CHARACTERSETS' doesn't exist
Hibernate Envers - REVINFO table doesn't exist
Hibernate Envers - REVINFO table doesn't exist  Hi, In my project I have to save the data change log. For this we are using the Hibernate Envers...: Hibernate Envers - REVINFO table doesn't exist How to resolve this? Thanks
JDBC
retrieve the value from database into dropdown list using JDBC SQL 2005  How to retrieve the value from database into dropdown list using JDBC &...;html> <form name="form" method="post" > <b>Select a country:</b>
please provide code - Java Beginners
please provide code  provide code to snake game in J2SE
provide code - Swing AWT
provide code  Dear frnds please provide code for two player CHESS GAME.....using swings,awt concepts   Hi friend, import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; public
jdbc - JDBC
jdbc   i use pool connection for my application but whenever i insert data into database ,sometimes two copy of the data have been entered... of entering the two copy of data into database . please provide me the full code
JDBC
JDBC  How to add set of queries in a single query in JDBC
jdbc code - JDBC
jdbc code  are jdbc code for diferent programs are same or different?please provide me simple jdbc code with example?  Hi Friend, Please visit the following link: http://www.roseindia.net/jdbc/ Here you
jdbc
jdbc  I compiling my jdbcodbc progrm. D:\Java\jdk1.6.0\bin>javac JdbcExample.java JdbcExample.java:12: cannot find symbol symbol : method...); } try{ Connection con; con=DriverManager.getConnection("jdbc:odbc:student
JDBC - JDBC
explanation of JDBC drivers  Need tutorial on JDBC driversThanks!  Hello,There are four types of JDBC drivers. There are mainly four type of JDBC drivers available. They are:Type 1 : JDBC-ODBC Bridge Driver A JDBC-ODBC
provide me code - Java Beginners
provide me code  can any body provide code for SNAKE XENZIA game in NOKIA mobile? please urgently
jdbc
jdbc  please tell me sir.i dont know JDBC connection and how to create table in database

Ads