//Source file: C:\\Rose2Java\\zhsoft\\dbcon\\QueryResult.java

package com.dbms.dbcon;

import java.util.Vector;

/**
 * 数据库查询结果集
 *
 * @author 雨亦奇(zhsoft88@sohu.com)
 * @version 1.0
 * @since 2003.05.18
 */
public class QueryResult extends Vector
{

    /**
     * @roseuid 3ED8687E02FB
     */
    public QueryResult()
    {

    }

    /**
     * 取一行结果
     *
     * @param lineno - 行号
     * @return zhsoft.dbcon.ResultRow
     * @throws java.lang.Exception
     * @roseuid 3ED55155003C
     */
    public ResultRow getRow(int lineno) throws Exception
    {
        if (this.size() == 0) {
            throw new Exception("结果集中记录为0");
        }
        if (lineno < 0 || lineno >= this.size()) {
            throw new Exception("无指定行号的记录,行号范围[0.." + (this.size() - 1) + "]");
        }
        return (ResultRow) ( (ResultRow) (this.elementAt(lineno))).clone();
    }
}