Results 1 to 7 of 7
  1. #1
    swati.jyoti is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Question More than 1 preparedStatement object

    Hey but i want to use more than one preparedStatement object using batch update

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    832
    Rep Power
    6

    Default

    Hi,
    Iam not getting you.
    1.For a single PreparedStatement object u can pass single query using that you can insert/update multiple values as a batch(i.e) single transaction.For each and every value passing you have to call "addbatch().Finally you have to call executeBatch().So,entire batch will be executed in a single transaction.
    One PreparedStatement object contains only one query.

    2.Again if you want to have differenent query you need to create another PreparedStatement object and do the same process what I mentioned in the above step.

    -Regards
    Ramya
    Last edited by RamyaSivakanth; 06-02-2009 at 11:50 AM.
    Ramya:cool:

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

  5. #5
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    832
    Rep Power
    6

    Default

    Hi Swathi,
    Already we have discussed regarding this with example.I don't know why you are getting doubts.Please go thru this thread for recalling what we did and send the piece of code what u have tried now.

    http://www.java-forums.org/database/...t-queries.html

    -Regards
    Ramya
    Ramya:cool:

  6. #6
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    448
    Rep Power
    6

    Default

    Is more than one preparedStatement object using batch update right one??
    Mak
    (Living @ Virtual World)

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Replies: 4
    Last Post: 05-12-2009, 12:48 PM
  2. Using PreparedStatement
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-22-2007, 11:24 AM
  3. PreparedStatement
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-05-2007, 03:56 PM
  4. calendar object in preparedStatement
    By Heather in forum SWT / JFace
    Replies: 3
    Last Post: 06-30-2007, 02:47 PM
  5. Help me. PreparedStatement
    By Felissa in forum JDBC
    Replies: 2
    Last Post: 06-28-2007, 05:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •