How to tell if I can update/delete the current result set row ina ResultSet?

Discussion in 'Java' started by =?ISO-8859-1?Q?Thomas_Gagn=E9?=, Nov 19, 2003.

  1. I'm reviewing lesson notes on JDBC and am stumped by a comment:

    * While iterating through a ResultSet you can update or delete the
    current result set row from the database if:
    o The DBMS & JDBC driver support updateable result sets
    o The SQL statement meets the requirements for updateable
    result sets:
    + The statement was created with the
    ResultSet.CONCUR_UPDATABLE flag.
    + The ResultSet's methods getType() and getConcurrency()
    return the types of the result set actually produced.

    It's the last bullet item I don't understand. Can anyone elaborate?

    --
    ..tom
    remove email address' dashes for replies
    opensource middleware at <http://isectd.sourceforge.net>
    http://gagne.homedns.org
    =?ISO-8859-1?Q?Thomas_Gagn=E9?=, Nov 19, 2003
    #1
    1. Advertising

  2. =?ISO-8859-1?Q?Thomas_Gagn=E9?= wrote:
    >
    > I'm reviewing lesson notes on JDBC and am stumped by a comment:
    >
    > * While iterating through a ResultSet you can update or delete the
    > current result set row from the database if:
    > o The DBMS & JDBC driver support updateable result sets
    > o The SQL statement meets the requirements for updateable
    > result sets:
    > + The statement was created with the
    > ResultSet.CONCUR_UPDATABLE flag.
    > + The ResultSet's methods getType() and getConcurrency()
    > return the types of the result set actually produced.
    >
    > It's the last bullet item I don't understand. Can anyone elaborate?


    When the JDBC Driver receives a createStatement() requesting specific result set type
    and concurrency, it doesn't know if it can satisfy that requirement for all
    executeQuery() calls under the statement. Some drivers may throw an exception on the
    executeQuery(), but most will just downgrade the type and concurrency to that possible
    given the actual SQL command. You can verify the actual type/concurrency for a given
    result set with the above getXXX() methods, or you can just wait for an exception when
    you attempt something that is not possible.

    --
    Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
    Lee Fesperman, Nov 21, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gen
    Replies:
    2
    Views:
    3,651
    Filip Larsen
    Mar 7, 2004
  2. Tincy
    Replies:
    0
    Views:
    1,874
    Tincy
    Jan 13, 2009
  3. D
    Replies:
    0
    Views:
    206
  4. Michael Tan
    Replies:
    32
    Views:
    967
    Ara.T.Howard
    Jul 21, 2005
  5. Replies:
    3
    Views:
    375
Loading...

Share This Page