01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.outerj.daisy.install;
17:
18: import java.io.Reader;
19: import java.sql.SQLException;
20: import java.sql.Connection;
21:
22: public interface DatabaseSpecifics {
23: /**
24: * Get the database function that returns the current date and time.
25: */
26: String getCurrentDateTimeFunction();
27:
28: /**
29: * Checks whether the database server supports transactions
30: * (this is needed in case of MySQL to assure that InnoDB tables are activated).
31: * @param conn
32: */
33: public void checkForTransactions(Connection conn)
34: throws SQLException, Exception;
35:
36: /**
37: * Returns statements that have to be executed before the script starts running.
38: */
39: public String[] getPreStatements();
40:
41: /**
42: * Returns statements that have to be executed before the script starts running.
43: */
44: public String[] getPostStatements();
45:
46: public char getStatementSeparator();
47:
48: /**
49: * Indicates whether the statement separator has to be dropped or not
50: * (which is e.g. the case for Oracle).
51: */
52: public boolean getDropStatementSeparator();
53:
54: public Reader getSchemaScript();
55:
56: public Reader getDataScript();
57:
58: /**
59: * Makes the current database empty. This is used by the testcases to start
60: * from a fresh state for each testcase.
61: *
62: * <p>This method should make the database empty, as if were just created as new.
63: */
64: public void clearDatabase(String dbUrl, String dbName,
65: String dbUser, String dbPassword) throws SQLException;
66:
67: public String getForeignKeyStatement(String table, String field,
68: String otherTable, String otherField, String constraintName);
69:
70: public String getTestStatement();
71: }
|