Sha256: 417754ca2367c3a2a16a663530dcdbeee52e6e5d213a7afaabab8e20f46947f4
Contents?: true
Size: 1.15 KB
Versions: 10
Compression:
Stored size: 1.15 KB
Contents
package com.rho.db; import org.hsqldb.Row; import org.hsqldb.Table; import org.hsqldb.Column; public class HsqlDBRowResult extends HsqlDBResult { Table m_table; Row m_row; HsqlDBRowResult(){} void init( Table table, Row row ){ m_table = table; m_row = row; } public int getCount(){ return m_row != null ? 1 : 0; } public int getColCount(){ return m_table != null ? m_table.getColumnCount() : 0; } public String getColName(int nCol){ Object col = m_table.columnList.get(nCol); return ((Column)col).columnName.name.toLowerCase(); } //Object[] getItem(int nItem){ // if ( m_row == null || nItem < 0 || nItem >= getCount() ) // return null; // return m_row.getData(); //} public boolean isEnd() { return m_row == null; } public void next() { m_row = null; } protected Object getCurValue(int nCol) { return m_row.getData()[nCol]; } int findColIndex(String colname ) { for( int i = 0; i < getColCount(); i++ ) { Object col = m_table.columnList.get(i); if ( ((Column)col).columnName.name.equalsIgnoreCase(colname) ) return i; } return -1; } }
Version data entries
10 entries across 10 versions & 1 rubygems