org.openmdx.compatibility.base.dataprovider.layer.persistence.jdbc
Class FastResultSet

java.lang.Object
  extended by org.openmdx.compatibility.base.dataprovider.layer.persistence.jdbc.FastResultSet

public class FastResultSet
extends Object

FastResultSet Optimizes the access to a ResultSet and guarantees that a column is read at most once. This is required because for certain jdbc drivers (e.g. JdbcOdbc driver in .NET) a) rs.getObject() is very slow and b) may be called at most once.


Constructor Summary
FastResultSet(AbstractDatabase_1 database, ResultSet rs)
           
FastResultSet(AbstractDatabase_1 database, ResultSet rs, List columnNames)
           
 
Method Summary
 boolean absolute(int position)
           
 List getColumnNames()
           
static List getColumnNames(ResultSetMetaData rsmd)
           
 Object getObject(String columnName)
          Reads specified column from result set.
 boolean next()
           
 void reset()
           
protected  Object toJdbcObject(Object nativeObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastResultSet

public FastResultSet(AbstractDatabase_1 database,
                     ResultSet rs)
              throws SQLException
Throws:
SQLException

FastResultSet

public FastResultSet(AbstractDatabase_1 database,
                     ResultSet rs,
                     List columnNames)
              throws SQLException
Throws:
SQLException
Method Detail

getColumnNames

public static List getColumnNames(ResultSetMetaData rsmd)
                           throws SQLException
Throws:
SQLException

getObject

public Object getObject(String columnName)
                 throws SQLException
Reads specified column from result set. Guarantees that columns OBJECT_OID, OBJECT_RID and OBJECT_IDX are read at most once otherwise error 'ResultSet can not re-read row data for column' is thrown by certain JDBC drivers.

Throws:
SQLException

reset

public void reset()
           throws SQLException
Throws:
SQLException

next

public boolean next()
             throws SQLException
Throws:
SQLException

absolute

public boolean absolute(int position)
                 throws SQLException
Throws:
SQLException

getColumnNames

public List getColumnNames()

toJdbcObject

protected Object toJdbcObject(Object nativeObject)
                       throws SQLException
Throws:
SQLException


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.