KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > install > OracleDatabaseSpecifics


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.InputStream JavaDoc;
19 import java.io.InputStreamReader JavaDoc;
20 import java.io.Reader JavaDoc;
21 import java.sql.SQLException JavaDoc;
22
23 public class OracleDatabaseSpecifics implements DatabaseSpecifics {
24     private final char statementSeparator = '/';
25     private final boolean dropStatementSeparator = true;
26
27     public String JavaDoc getCurrentDateTimeFunction() {
28         return "SysDate";
29     }
30
31     public String JavaDoc[] getPreStatements() {
32         return new String JavaDoc[0];
33     }
34
35     public String JavaDoc[] getPostStatements() {
36         return new String JavaDoc[0];
37     }
38
39     public char getStatementSeparator() {
40         return statementSeparator;
41     }
42
43     public boolean getDropStatementSeparator() {
44         return dropStatementSeparator;
45     }
46
47     public Reader JavaDoc getSchemaScript() {
48         InputStream JavaDoc schemaScriptIS = getClass().getResourceAsStream("/org/outerj/daisy/install/oracle-daisy-schema.sql");
49         return new InputStreamReader JavaDoc(schemaScriptIS);
50     }
51
52     public Reader JavaDoc getDataScript() {
53         InputStream JavaDoc dataScriptIS = getClass().getResourceAsStream("/org/outerj/daisy/install/oracle-daisy-data.sql");
54         return new InputStreamReader JavaDoc(dataScriptIS);
55     }
56
57     public void clearDatabase(String JavaDoc dbUrl, String JavaDoc dbName, String JavaDoc dbUser, String JavaDoc dbPassword) throws SQLException JavaDoc {
58         // TODO
59
;
60     }
61
62     public String JavaDoc getForeignKeyStatement(String JavaDoc table, String JavaDoc field, String JavaDoc otherTable, String JavaDoc otherField, String JavaDoc constraintName) {
63         return "alter table " + table + " add constraint " + constraintName + " foreign key (" + field + ") references " + otherTable + " (" + otherField + ")";
64     }
65
66     public String JavaDoc getTestStatement() {
67         return "select 1 from dual";
68     }
69 }
70
Popular Tags