This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC resultset is retreiving only 100 records sometimes from DB, but it has 3000+ records Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "JDBC resultset is retreiving only 100 records sometimes from DB, but it has 3000+ records" Watch "JDBC resultset is retreiving only 100 records sometimes from DB, but it has 3000+ records" New topic
Author

JDBC resultset is retreiving only 100 records sometimes from DB, but it has 3000+ records

naveen arak
Greenhorn

Joined: Oct 23, 2012
Posts: 2
I'm using JDBC code to fetch data from datbase, I put sysouts in PROD and found like most of the times resultset is getting all 3000+ results from database but it is getting exactly 100 records few times. I'm not able to trace the issue as it is happening only in PROD but not in lower environments. I'm using RAD with websphere app server, database is sybase. Please find my code below:
String sqlStatement = "{ call STOREDPROCEDURE_ITEMS(?,?) }";
try {
databaseAccess = DatabaseManager.GetDatabaseAccess(true);
callableStatement = databaseAccess.prepareCall(sqlStatement);
callableStatement.registerOutParameter(1, Types.INTEGER);
callableStatement.registerOutParameter(2, Types.VARCHAR);
try {
resultset = callableStatement.executeQuery();
if (resultset != null) {
while (resultset.next()) {
item= BuildItems(resultset);
items.add(item);
cache.addItemToCache(item);
}
}
System.out.println("items size"+ items.szie());
} catch (SQLException sqlException) { }
finally(){
databaseAccess.close();
} }
[/code]
Could someone please help me on this.

Thanks, Naveen
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1098

your not showing us how you handle the result set, how you are knowing how many records are returned?
naveen arak
Greenhorn

Joined: Oct 23, 2012
Posts: 2
Added remaining code
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

naveen arak, please BeForthrightWhenCrossPostingToOtherSites
http://stackoverflow.com/questions/13035036/jdbc-resultset-is-retreiving-only-100-records-sometimes-from-db-but-it-has-3000
http://www.java-forums.org/jdbc/63822-sometimes-jdbc-resultset-not-getting-all-3000-records-showing-only-100-records.html


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JDBC resultset is retreiving only 100 records sometimes from DB, but it has 3000+ records
 
Similar Threads
Newbie needs help with "Object has been closed" exception
Problem accessing AS/400 database thru' JDBC
No suitable driver error.
CachedRowSet giving "SQLException" when using nextPage( ) method on it.
How to access Stored Procedure