KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > resultsetmetadata > SelectRowReader


1 package com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata;
2
3 import com.daffodilwoods.daffodildb.server.datadictionarysystem.*;
4 import com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents.*;
5 import com.daffodilwoods.daffodildb.utils.field.*;
6 import com.daffodilwoods.database.resource.*;
7
8 /**
9  *
10  * <p>Title: SelectRowReader</p>
11  * <p>Description:
12  * This class represents a RowReader which is initiated when resultSet is of
13  * type NONSCROLLABLE.
14  * This clas provides the functionality of reading and writing a row returned
15  * from resultset.
16  * </p>
17  * <p>Copyright: Copyright (c) 2003</p>
18  * <p>Company: Daffodil S/W Ltd.</p>
19  * @author SelectTeam
20  * @version 1.0
21  */

22
23 public class SelectRowReader implements _RowReader {
24
25    /**
26     * Represents the characteristics of select query.
27     */

28
29    _ColumnCharacteristics columnCharacteristics;
30
31    /**
32     * Represents the chained columns present in select query.
33     */

34
35    ForeignKeyColumns[] columns;
36
37    public SelectRowReader(_ColumnCharacteristics columnCharacteristics, ForeignKeyColumns[] columns0) {
38       this.columnCharacteristics = columnCharacteristics;
39       columns = columns0;
40    }
41
42    /**
43     * For documentation of following methods, refer the documentation of
44     * _RowReader
45     */

46
47    public Object JavaDoc getObject(int index, Object JavaDoc row) throws DException {
48       return ( (FieldBase) ( (Object JavaDoc[]) row)[index - 1]).getObject();
49    }
50
51    public void setObject(int columnIndex, Object JavaDoc value, Object JavaDoc row) throws DException {
52       Object JavaDoc tobeUpdated = ( (Object JavaDoc[]) row)[columnIndex - 1];
53       if (value instanceof FieldBase) {
54          tobeUpdated = value;
55       } else {
56          ( (FieldBase) tobeUpdated).setObject(value);
57       }
58    }
59 }
60
Popular Tags