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 com.allaire.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        public String[] getColumnNamesAsString();
049        
050        public Collection.Key[] getColumnNames();
051
052
053        /**
054         * returns one field of a Query as String
055         * @param row
056         * @param col
057         * @return data from query object
058         * @throws IndexOutOfBoundsException
059         */
060        public String getData(int row, int col) throws IndexOutOfBoundsException;
061
062        /**
063         * @return returns name of the query
064         */
065        public String getName();
066
067        /**
068         * @return returns row count
069         */
070        public int getRowCount();
071
072        /**
073         * sets value at a defined position in Query
074         * @param row
075         * @param col
076         * @param value
077         * @throws IndexOutOfBoundsException
078         */
079        public void setData(int row, int col, String value)
080                        throws IndexOutOfBoundsException ;
081
082}