KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nilostep > xlsql > database > xlDatabase


1 /*(Header: NiLOSTEP / xlSQL)
2
3  Copyright (C) 2004 NiLOSTEP
4    NiLOSTEP Information Sciences
5    http://nilostep.com
6    nilo.de.roock@nilostep.com
7
8  This program is free software; you can redistribute it and/or modify it under
9  the terms of the GNU General Public License as published by the Free Software
10  Foundation; either version 2 of the License, or (at your option) any later
11  version.
12
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16  more details. You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software Foundation,
18  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */

20 package com.nilostep.xlsql.database;
21
22 import com.nilostep.xlsql.sql.xlSqlSelect;
23
24
25
26 /**
27  * A database representing a set of ordered documents
28  *
29  * @version $Revision: 1.12 $
30  * @author $author$
31  */

32 public interface xlDatabase {
33
34     /**
35      *
36      *
37      * @param schema schema type of identifier for document
38      * @param table table type of identifier for document
39      */

40     public void addRow(String JavaDoc schema, String JavaDoc table) ;
41
42     /**
43      * return an array with column names
44      *
45      * @param schema schema type of identifier for document
46      * @param table table type of identifier for document
47      *
48      * @return column names
49      */

50     public String JavaDoc[] getColumnNames(String JavaDoc schema, String JavaDoc table) ;
51
52     /**
53      * return an array with column types
54      *
55      * <p>e.g. {"VARCHAR", "DOUBLE", BIT", "DATE"}</p>
56      *
57      * @param schema schema type of identifier for document
58      * @param table table type of identifier for document
59      *
60      * @return column types
61      */

62     public String JavaDoc[] getColumnTypes(String JavaDoc schema, String JavaDoc table) ;
63
64     /**
65      * return a matrix representation of a document
66      *
67      * @param schema schema type of identifier for document
68      * @param table table type of identifier for document
69      *
70      * @return data
71      *
72      * @throws xlException DOCUMENT ME!
73      */

74     public String JavaDoc[][] getValues(String JavaDoc schema, String JavaDoc table)
75                          throws xlException ;
76
77     /**
78      * return the number of rows in the document
79      *
80      * <p> A document may contain headers, types, possibly other information.
81      * The number of rows is always limited to row<strong>data</strong></p>
82      *
83      * @param schema schema type of identifier for document
84      * @param table table type of identifier for document
85      *
86      * @return row count
87      */

88     public int getRows(String JavaDoc schema, String JavaDoc table) ;
89
90     /**
91      * Return an array with schema names
92      *
93      * @return schema names
94      */

95     public String JavaDoc[] getSchemas() ;
96
97     /**
98      * Return an array with schema names
99      *
100      * @param schema type of identifier for document
101      *
102      * @return table names in schema
103      */

104     public String JavaDoc[] getTables(String JavaDoc schema) ;
105
106     /**
107      * Add a schema to the database
108      *
109      * @param schema schema type of identifier for document
110      */

111     public void addSchema(String JavaDoc schema) ;
112
113     /**
114      * Add a table to a database schema
115      *
116      * @param schema schema type of identifier for document
117      * @param table table type of identifier for document
118      */

119     public void addTable(String JavaDoc schema, String JavaDoc table) ;
120
121     /**
122      * Flush changes
123      *
124      * @param query handle to Sql Engine
125      *
126      * @throws Exception /REPLACE WITH xlEXCEPTION/
127      */

128     public void flush(xlSqlSelect query) throws Exception JavaDoc ;
129
130     /**
131      * Remove a table
132      *
133      * @param schema schema type of identifier for document
134      * @param table table type of identifier for document
135      */

136     public void removeTable(String JavaDoc schema, String JavaDoc table) ;
137
138     /**
139      * Verify if schema exists
140      *
141      * @param schema schema type of identifier for document
142      *
143      * @return true if exists
144      */

145     public boolean schemaExists(String JavaDoc schema) ;
146
147     /**
148      * Verify if table exists
149      *
150      * @param schema schema type of identifier for document
151      * @param table table type of identifier for document
152      *
153      * @return true if exists
154      */

155     public boolean tableExists(String JavaDoc schema, String JavaDoc table) ;
156
157     /**
158      * Add schema to the flush queue
159      *
160      * @param schema schema type of identifier for document
161      */

162     public void touchSchema(String JavaDoc schema) ;
163
164     /**
165      * Add table to the flush queue
166      *
167      * @param schema schema type of identifier for document
168      * @param table table type of identifier for document
169      */

170     public void touchTable(String JavaDoc schema, String JavaDoc table) ;
171 }
Popular Tags