Java 获取Oracle ROWID_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > Java 获取Oracle ROWID

Java 获取Oracle ROWID

 2012/4/18 2:31:08  aijuans  程序员俱乐部  我要评论(0)
  • 摘要:AROWIDisanidentificationtaguniqueforeachrowofanOracleDatabasetable.TheROWIDcanbethoughtofasavirtualcolumn,containingtheIDforeachrow.Theoracle.sql.ROWIDclassissuppliedasacontainerforROWIDSQLdatatype.IfyouincludetheROWIDpseudo-columninaquery
  • 标签:ORA Java Oracle

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
?
发表评论
用户名: 匿名