zoukankan      html  css  js  c++  java
  • Java 获取Oracle ROWID

    A ROWID is an identification tag unique for each row of an Oracle Database table. The ROWID can be thought of as a virtual column, containing the ID for each row.

    The oracle.sql.ROWID class is supplied as a container for ROWID SQL data type.

    If you include the ROWID pseudo-column in a query, then you can retrieve the ROWIDs with the result set getString method. You can also bind a ROWID to a PreparedStatement parameter with the setString method. This enables in-place updating, as in the example that follows.
    Note: Use the oracle.sql.ROWID class, only when you are
    using J2SE 1.5. For JSE 6, you should use the standard
    java.sql.RowId interface instead.
    ResultSet rst = stmt.executeQuery("select rowid,name from friend");
    ...
    String rowid
    =rst.getString(1);
    ...

    //or

    RowId rowid
    = rst.getRowId(1); // Get the ROWID as a String

      

  • 相关阅读:
    1046 A^B Mod C
    1019 逆序数
    1012 最小公倍数LCM
    1011 最大公约数GCD
    序列化
    bigdecimal
    equals 和hashcode
    java多线程-读写锁原理
    Java并发编程:volatile关键字解析
    面试
  • 原文地址:https://www.cnblogs.com/freewater/p/2156200.html
Copyright © 2011-2022 走看看