• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can you do this

 
ben riches
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
 
Tina Coleman
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 ]
 
Jamie Robertson
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