| 1 16 package org.outerj.daisy.install; 17 18 import java.io.InputStream ; 19 import java.io.InputStreamReader ; 20 import java.io.Reader ; 21 import java.sql.SQLException ; 22 23 public class OracleDatabaseSpecifics implements DatabaseSpecifics { 24 private final char statementSeparator = '/'; 25 private final boolean dropStatementSeparator = true; 26 27 public String getCurrentDateTimeFunction() { 28 return "SysDate"; 29 } 30 31 public String [] getPreStatements() { 32 return new String [0]; 33 } 34 35 public String [] getPostStatements() { 36 return new String [0]; 37 } 38 39 public char getStatementSeparator() { 40 return statementSeparator; 41 } 42 43 public boolean getDropStatementSeparator() { 44 return dropStatementSeparator; 45 } 46 47 public Reader getSchemaScript() { 48 InputStream schemaScriptIS = getClass().getResourceAsStream("/org/outerj/daisy/install/oracle-daisy-schema.sql"); 49 return new InputStreamReader (schemaScriptIS); 50 } 51 52 public Reader getDataScript() { 53 InputStream dataScriptIS = getClass().getResourceAsStream("/org/outerj/daisy/install/oracle-daisy-data.sql"); 54 return new InputStreamReader (dataScriptIS); 55 } 56 57 public void clearDatabase(String dbUrl, String dbName, String dbUser, String dbPassword) throws SQLException { 58 ; 60 } 61 62 public String getForeignKeyStatement(String table, String field, String otherTable, String otherField, String constraintName) { 63 return "alter table " + table + " add constraint " + constraintName + " foreign key (" + field + ") references " + otherTable + " (" + otherField + ")"; 64 } 65 66 public String getTestStatement() { 67 return "select 1 from dual"; 68 } 69 } 70 | Popular Tags |