Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How can you do this  RSS feed

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone
I have an arraylist with 40 elemets inside it.
I want to be able to get the first 10 elements of the arraylist and put them into a sql statement (I can do this ok) but the problem is when i want to get the next 10 elements (from 10 to 20) they will not execute to the database. is this possible with just one prepared statement?
thanks
ben
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should be possible with the one PreparedStatement - the whole idea of a PreparedStatement is to use it again.
Can you post what you've got so far?
 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my code so far i just cannot seem to set up the sql statement using one arraylist
thanks
ben

[ Edited by Dave to format code and remove smilies - hopefully this helps :roll: ]
[ January 17, 2003: Message edited by: David O'Meara ]
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben, there is way to much code and processing to hammer through. Maybe you can explain your specific problem a little more, accompanied by a code snippet(10-15 lines of code) that illustrates/identifies your specific problem. You might want to group your code up into related parts and create methods or objects out of the related code. Or you can do neither and keep waiting for a reply!
 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is where my problem is. I want to be able to get the first 10 values from the arraylist and add them to the first column name then i want to get the next 10 values (10 to 20) and put them into a diffrent column name. but only using one preparedStatement.
thanks
ben

[ January 18, 2003: Message edited by: ben riches ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!