Source code: com/rohanclan/ashpool/core/ConnectionManager.java
1 /*
2 * Ashpool - XML Database
3 * Copyright (C) 2003 Rob Rohan
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 675 Mass Ave, Cambridge, MA 02139, USA.
17 *
18 *
19 * ConnectionManager.java
20 *
21 * Created on February 1, 2003, 10:43 AM
22 */
23
24 package com.rohanclan.ashpool.core;
25
26 /**
27 *
28 * @author rob
29 */
30 public class ConnectionManager {
31
32 private TableManager tableman;
33 private CommandManager comman;
34 private AResultSet ars; //scratch pad result set
35
36 /** Creates a new instance of ConnectionManager */
37 public ConnectionManager(java.io.File datasource) throws Exception {
38 tableman = new TableManager(datasource);
39 comman = new CommandManager();
40 comman.setTableManager(tableman);
41 ars = new AResultSet();
42 }
43
44 /** gets a handle to the table manager */
45 public TableManager getTableManager(){
46 return this.tableman;
47 }
48
49 /** gets a list of tables in the datastore */
50 public AResultSet getTables(){
51 ars.reset();
52 getTableManager().getTables(ars);
53 return ars;
54 }
55
56 /** executes a query string */
57 public AResultSet executeStatement(String query) throws Exception {
58 return comman.executeStatement(query);
59 }
60
61 /** executes a query string */
62 public AResultSet executeStatement(String query, byte type) throws Exception {
63 //return comman.executeStatement(query, type);
64 return null;
65 }
66
67 }