Results 1 to 5 of 5
  1. #1
    raghavendranj is offline Member
    Join Date
    May 2012
    Posts
    2
    Rep Power
    0

    Post Will setkeycolumns of cachedrowset validates duplicate entery?

    Whether the setkeycolumns of cachedrowset method will do the null and duplicate validation at the time of save method call?
    If no, then how to perform primary key validation in cachedrow set.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: Will setkeycolumns of cachedrowset validates duplicate entery?

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: Will setkeycolumns of cachedrowset validates duplicate entery?

    Looking at the API there is nothing in the contract that says that the primary key must be checked before the acceptChanges is called.
    I suspect this is because it is unlikely that a CachedRowSet will represent the whole contents of a table, so any check will be incomplete anyway.
    So, it's implementation dependent.
    Run it with whatever JDBC implementation you're using and see.
    If it doesn't validate then you'll simply have to work something out around when the update/insert is done on the database.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    raghavendranj is offline Member
    Join Date
    May 2012
    Posts
    2
    Rep Power
    0

    Default Re: Will setkeycolumns of cachedrowset validates duplicate entery?

    ok thanks for the reply.

    Can i able to upate more than one table (multi table update) in cached row set

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,097
    Rep Power
    20

    Default Re: Will setkeycolumns of cachedrowset validates duplicate entery?

    I have no idea.
    I suspect it first off depends on whether the database supports it (some may not), and the second whether the JDBC driver does.
    Should be easy to set up a basic test of the concept.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 5
    Last Post: 06-03-2012, 08:20 PM
  2. CachedRowSet wont update data source
    By diamonddragon in forum JDBC
    Replies: 5
    Last Post: 02-10-2012, 01:00 PM
  3. Replies: 3
    Last Post: 01-16-2012, 12:12 PM
  4. Duplicate table
    By anilkumar_vist in forum New To Java
    Replies: 3
    Last Post: 01-09-2010, 12:17 PM
  5. Sorting CachedRowset
    By Sayed in forum Advanced Java
    Replies: 0
    Last Post: 07-18-2008, 01:14 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
  •