• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your not showing us how you handle the result set, how you are knowing how many records are returned?
 
naveen arak
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Added remaining code
 
reply
    Bookmark Topic Watch Topic
  • New Topic