Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Two insertion into RDBMS

  1. #1
    Member
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Two insertion into RDBMS

    Hi all ,
    I have been working on JDBC newly i have to same record into 2 tables at same time will it be possible with 2 insert statements at same time if so could please give me a small example code.

    Thanks in advance


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Two insertion into RDBMS

    Please do not post the same question to the forums multiple times. Your other post has been removed.

    This is more of an SQL question. As far as I know, you need 2 statements. You can do them in a transaction (in case the second fails you can foll back the previous).

  3. #3
    Member
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Two insertion into RDBMS

    two tables have some common records i.e when we do JDBC insertion can we insert into 2 tables at same time using a prepared statement.If so can give me some code examples .

  4. #4
    Member
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to update 2 tables in database using JDBC

    hi all,
    Can anyone tell me how to update 2 tables in database at same time using JDBC please this is urgent .If possible can you provide me some code please its urgent

  5. #5
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Two insertion into RDBMS

    You obviously haven't read my my post above (or the forum rules). Most notably the first sentence: this is your second warning - do not post the same question in new threads.

    First step: read my post above. Second step, create two insert statements. If you want to truly do a single update (the reason of which I still do not understand), create a view, stored procedure, or trigger - all of which are database issues that are beyond the scope of this forum.

  6. The Following User Says Thank You to copeg For This Useful Post:

    planmaster (November 14th, 2010)

Similar Threads

  1. [SOLVED] Sorting a vector using insertion
    By DM21 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 25th, 2010, 05:36 PM
  2. Pseudo code of insertion sort linked list
    By sungirl in forum Algorithms & Recursion
    Replies: 1
    Last Post: May 23rd, 2010, 09:25 AM
  3. Replies: 1
    Last Post: May 19th, 2009, 09:19 AM