KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mckoi > database > jdbc > LocalBootable


1 /**
2  * com.mckoi.database.jdbc.LocalBootable 16 Aug 2000
3  *
4  * Mckoi SQL Database ( http://www.mckoi.com/database )
5  * Copyright (C) 2000, 2001, 2002 Diehl and Associates, Inc.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * Version 2 as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License Version 2 for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * Version 2 along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  * Change Log:
21  *
22  *
23  */

24
25 package com.mckoi.database.jdbc;
26
27 import com.mckoi.database.control.DBConfig;
28 import java.io.File JavaDoc;
29 import java.sql.SQLException JavaDoc;
30
31 /**
32  * An interface that is implemented by an object that boots up the database.
33  * This is provided as an interface so that we aren't dependant on the
34  * entire database when compiling the JDBC code.
35  *
36  * @author Tobias Downer
37  */

38
39 public interface LocalBootable {
40
41   /**
42    * Attempts to create a new database system with the given name, and the
43    * given username/password as the admin user for the system. Once created,
44    * the newly created database will be booted up.
45    *
46    * @param config the configuration variables.
47    * @returns a DatabaseInterface for talking to the database.
48    */

49   DatabaseInterface create(String JavaDoc username, String JavaDoc password,
50                            DBConfig config) throws SQLException JavaDoc;
51
52   /**
53    * Boots the database with the given configuration.
54    *
55    * @param config the configuration variables.
56    * @returns a DatabaseInterface for talking to the database.
57    */

58   DatabaseInterface boot(DBConfig config) throws SQLException JavaDoc;
59
60   /**
61    * Attempts to test if the database exists or not. Returns true if the
62    * database exists.
63    *
64    * @param config the configuration variables.
65    */

66   boolean checkExists(DBConfig config) throws SQLException JavaDoc;
67
68   /**
69    * Returns true if there is a database currently booted in the current
70    * JVM. Otherwise returns false.
71    */

72   boolean isBooted() throws SQLException JavaDoc;
73
74   /**
75    * Connects this interface to the database currently running in this JVM.
76    *
77    * @returns a DatabaseInterface for talking to the database.
78    */

79   DatabaseInterface connectToJVM() throws SQLException JavaDoc;
80
81 }
82
Popular Tags