Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inserting values from arraylist to the database

 
shriganesh kakade
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to insert the values from the arraylist to the database.
I am using string buffer.
I am new to this.
Please help.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you done any jdbc before? if not then start with the JDBC tutorial: http://docs.oracle.com/javase/tutorial/jdbc/index.html.

If you have done some, and are asking about batch inserts this thread has a pretty good answer in it: http://www.coderanch.com/t/306812/JDBC/java/Batch-Insert.

If you have any other queries please give more detail of your question.
 
shriganesh kakade
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
Thank you for your reply.
I had read the link you provided. I am aware of JDBC, I had done it before.
I had the same problem that is in second link you provided.
Want to add the two arraylists to two different tables with the same foreign key consider emp_id.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so we will do this 1 table at a time.
is this one arraylist updates 1 table? or bits of both arraylist are needed to update the table?

Have you got any thoughts at all about how to start this?
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The linked thread regards performance problems and honestly, the given solution is not the best you can achieve in Oracle.

Do you have performance problems, or is it something else? Are you on Oracle as well?
 
shriganesh kakade
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one list updates one table at a time, i.e. both lists update two different tables..
and i am using mysql server.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you have the sql statement for updating a single row?
can you show us that so we have something to work upon building up the batches for MQSQL
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am splitting your thread out into a new discusion for the servlets forum, as this doesn't sound much like JDBC anymore
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shriganesh kakade,
Your post was moved to a new topic.
split from a jdbc thread about batch inserts
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic