JDBC doesn't provide an EOF method.

Ads

 
 

Share on Google+Share on Google+

Clark
JDBC doesn't provide an EOF method.
1 Answer(s)      7 years ago
Posted in : JDBC

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

Ads
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.


Ads









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
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
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
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
jdbc
jdbc  is it possible to use doget & dopost method with jdbc to call in a servlet programe
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
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
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  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
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
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
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
please provide the code
please provide the code   Develop a multi-client chat application
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>
JDBC
JDBC  How to add set of queries in a single query in JDBC
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
Please provide the code
Please provide the code   Write a program to recursively download the web pages available in the given site URL
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
jdbc
jdbc  I compiling my jdbcodbc progrm. D:\Java\jdk1.6.0\bin>javac JdbcExample.java JdbcExample.java:12: cannot find symbol symbol : method...{ Connection con; con=DriverManager.getConnection("jdbc:odbc:student

Ads

 
Advertisement null

Ads