001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package org.opencfml.cfx; 020 021import java.sql.ResultSet; 022 023import lucee.runtime.type.Collection; 024 025/** 026 * Alternative Implementation of Jeremy Allaire's Query Interface 027 */ 028public interface Query extends ResultSet { 029 030 /** 031 * @return adds a row to resultset 032 */ 033 public int addRow(); 034 035 /** 036 * returns index of a columnName 037 * @param coulmnName column name to get index for 038 * @return index of a columnName 039 */ 040 public int getColumnIndex(String coulmnName); 041 042 /** 043 * @return All column Names of resultset as string 044 * @deprecated use instead <code>getColumnNamesAsString();</code> 045 */ 046 public String[] getColumns(); 047 048 /** 049 * @return All column Names of resultset as string array 050 * 051 */ 052 public String[] getColumnNamesAsString(); 053 054 /** 055 * @return All column Names of resultset as Collection.Key array 056 * 057 */ 058 public Collection.Key[] getColumnNames(); 059 060 061 /** 062 * returns one field of a Query as String 063 * @param row 064 * @param col 065 * @return data from query object 066 * @throws IndexOutOfBoundsException 067 */ 068 public String getData(int row, int col) throws IndexOutOfBoundsException; 069 070 /** 071 * @return returns name of the query 072 */ 073 public String getName(); 074 075 /** 076 * @return returns row count 077 */ 078 public int getRowCount(); 079 080 /** 081 * sets value at a defined position in Query 082 * @param row 083 * @param col 084 * @param value 085 * @throws IndexOutOfBoundsException 086 */ 087 public void setData(int row, int col, String value) 088 throws IndexOutOfBoundsException ; 089 090}