Example usage for java.sql DatabaseMetaData getRowIdLifetime

List of usage examples for java.sql DatabaseMetaData getRowIdLifetime

Introduction

In this page you can find the example usage for java.sql DatabaseMetaData getRowIdLifetime.

Prototype

RowIdLifetime getRowIdLifetime() throws SQLException;

Source Link

Document

Indicates whether this data source supports the SQL ROWID type, and the lifetime for which a RowId object remains valid.

Usage

From source file:com.oracle.tutorial.jdbc.JDBCTutorialUtilities.java

public static void rowIdLifetime(Connection conn) throws SQLException {
    DatabaseMetaData dbMetaData = conn.getMetaData();
    RowIdLifetime lifetime = dbMetaData.getRowIdLifetime();
    switch (lifetime) {
    case ROWID_UNSUPPORTED:
        System.out.println("ROWID type not supported");
        break;/*from   ww w .j  a v a  2  s .co  m*/
    case ROWID_VALID_FOREVER:
        System.out.println("ROWID has unlimited lifetime");
        break;
    case ROWID_VALID_OTHER:
        System.out.println("ROWID has indeterminate lifetime");
        break;
    case ROWID_VALID_SESSION:
        System.out.println("ROWID type has lifetime that is valid for at least the containing session");
        break;
    case ROWID_VALID_TRANSACTION:
        System.out.println("ROWID type has lifetime that is valid for at least the containing transaction");
    }
}