Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Insert multiple rows in database

 
Ishita Saha
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to code a program in Java with JDBC connection to ORACLE where I need to get say 200 rows from a table in database. Insert 50 more rows in the resultset and do some changes in the exisiting 200 rows (some column data) and then write it back to database. I

s there a way I can do this directly in the resultset and write back the result set (250 rows this time) back to database.

The other lenghty process will be to store the reslutset in a multidimensional array - do all changes in Array and then write the rows one by one. may be in a loop using prepared statement.

Can anybody please suggest a cleaner and faster approach.

Thanks in advance
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the examples in ResultSet documentation http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic