How to store Oracle Rowid in Java bean

By | August 20, 2018
Questions:

I am calling a stored procedure that is returning the rowid for a list of rows. I am having trouble with storing the actual rowid value in Java so I can then later use that rowid for a follow up update statement.

For example :

Select name, age, ROWID, from myTable where rownum<20;

I can store the name and age, but when I try to store ROWID in a string like:

    setRowID(workTableResponseJson.getString("ROWID"));

public void setRowID(String rowid) {
    this.rowid = rowid;
}

The value does not exactly match. I instead get a value like :oracle.sql.ROWID@123a123b

Does anyone know how to properly store the rowid value in Java so you can then later use it in a follow up statement?

Thank you.

Answers:

Leave a Reply

Your email address will not be published. Required fields are marked *