use of oracle.jdbc.rowset.OracleCachedRowSet in project adempiere by adempiere.
the class CCachedRowSet method getRowSet.
// get
/**
* Get and Execute Row Set.
* No parameters, Read-Only, Scroll Insensitive
* @param sql sql
* @param conn connection
* @param db database
* @return row set
* @throws SQLException
*/
public static RowSet getRowSet(String sql, Connection conn, AdempiereDatabase db) throws SQLException {
if (db.getName().equals(Database.DB_ORACLE)) {
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery(sql);
OracleCachedRowSet crs = new OracleCachedRowSet();
crs.populate(rs);
rs.close();
stmt.close();
return crs;
}
CachedRowSet crs = get();
crs.setConcurrency(ResultSet.CONCUR_READ_ONLY);
crs.setType(ResultSet.TYPE_SCROLL_INSENSITIVE);
crs.setCommand(sql);
crs.execute(conn);
return crs;
}
use of oracle.jdbc.rowset.OracleCachedRowSet in project adempiere by adempiere.
the class CCachedRowSet method getRowSet.
// get
/**
* Get Cached Row Set.
* Required due to Java Sun bug 393865.
* Also, Oracle NUMBER returns scale -127
* @param rs result set
* @param db database
* @return Cached Row Set
* @throws SQLException
*/
public static RowSet getRowSet(ResultSet rs, AdempiereDatabase db) throws SQLException {
if (db.getName().equals(Database.DB_ORACLE)) {
OracleCachedRowSet crs = new OracleCachedRowSet();
crs.populate(rs);
return crs;
}
CachedRowSet crs = get();
crs.populate(rs);
return crs;
}
Aggregations