Index: exectck/src/main/java/org/apache/jdo/exectck/SQLFileLoader.java =================================================================== --- exectck/src/main/java/org/apache/jdo/exectck/SQLFileLoader.java (nonexistent) +++ exectck/src/main/java/org/apache/jdo/exectck/SQLFileLoader.java (working copy) @@ -0,0 +1,350 @@ +/* + * Copyright 2006-2018 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jdo.exectck; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** + * Utility class to load SQL files via JDBC. + * + * The class expects a comment line including a connect statement + * defining url, user and password to connect to the database; e.g. + * -- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; + */ +public class SQLFileLoader { + + // the reader for the sql file + private Reader reader; + // holds the next character that ist just read from the reader + private int nextChar; + // holds the current SQL statement + private StringBuilder currentStmt = new StringBuilder(); + // flag indicating whether a SQL string literal is processed + private boolean scanStringLiteral = false; + // the list of SQL statements + private List statements = new ArrayList<>(); + // the JDBC connection url + private String connect; + // the JDBC connection user + private String user; + // the JDBC connection password + private String password; + + /** + * Constructor. + * Reads the SQL statements from the specified file. + * The internal state of the class is updated with the contents of the file + * and may be accessed using the getter methods (see below). + * @param filename the name of the sql to be loaded + * @throws IOException If an I/O error occurs + */ + public SQLFileLoader(String filename) throws IOException { + try (Reader r = new BufferedReader(new FileReader(filename))) { + // init reader instance variable + this.reader = r; + // initialize nextChar with the first character from the stream + this.nextChar = this.reader.read(); + + int currentChar = next(); + // read characters from the stream + while(currentChar != -1) { + accept(currentChar); + currentChar = next(); + } + this.reader = null; + } + } + + /** + * Returns the list of SQL statements processed by this SQLFileLoader. + * @return list of SQL statements + */ + public List getStatements() { + return this.statements; + } + + /** + * Returns the JDBC connection URL. + * @return the JDBC connection URL + */ + public String getConnect() { + return this.connect; + } + + /** + * Returns the JDBC connection user. + * @return the JDBC connection user. + */ + public String getUser() { + return this.user; + } + + /** + * Returns the JDBC connection password. + * @return the JDBC connection password + */ + public String getPassword() { + return this.password; + } + + /** + * Checks the specified character whether it terminates a SQL Statement. + * If so the current SQL statement is added to the list of processed SQL statements + * and a new SQL statement is initialized. Otherwise the method appends the specified + * character to the current SQL statement. + * @param value character to be checked + */ + private void accept(int value) { + if (value == ';' && !this.scanStringLiteral) { + // found statement end + statements.add(currentStmt.toString()); + currentStmt = new StringBuilder(); + } else { + currentStmt.append((char) value); + } + } + + /** + * Returns the next character from the input that is not part of a comment. + * That means single line comments and multi line comments are skipped. + * The method is able to handle SQL String literals. + * @return the next non comment character + * @throws IOException If an I/O error occurs + */ + private int next() throws IOException { + int result = this.nextChar; + switch (this.nextChar) { + case '\'' : + this.scanStringLiteral = !this.scanStringLiteral; + this.nextChar = this.reader.read(); + break; + case '/' : + if (!this.scanStringLiteral) { + int next = this.reader.read(); + if (next == '*') { + this.nextChar = this.reader.read(); + skipToEndOfMLComment(); + skipWhitespaces(); + return next(); + } else { + this.nextChar = next; + } + } else { + this.nextChar = this.reader.read(); + } + break; + case '-': + if (!this.scanStringLiteral) { + int next = this.reader.read(); + if (next == '-') { + this.nextChar = reader.read(); + handleSingleLineComment(); + skipWhitespaces(); + return next(); + } else { + this.nextChar = next; + } + } else { + this.nextChar = this.reader.read(); + } + break; + case ' ' : + case '\t' : + case '\n' : + if (!this.scanStringLiteral) { + skipWhitespaces(); + result = ' '; + } else { + this.nextChar = this.reader.read(); + } + break; + default : + this.nextChar = this.reader.read(); + break; + } + return result; + } + + /** + * Skips a single line comment. + * That means any character from -- to the end of the line are akipped. + * @throws IOException If an I/O error occurs + */ + private void handleSingleLineComment() throws IOException { + Optional optConnect = readIdentFollowedByLiteral("connect"); + optConnect.ifPresent(x -> this.connect = x); + Optional optUser = readIdentFollowedByLiteral("user"); + optUser.ifPresent(x -> this.user = x); + Optional optPassword = readIdentFollowedByLiteral("password"); + optPassword.ifPresent(x -> this.password = x); + skipToEOL(); + } + + /** + * Tries to read an Java identifier with the expected name followed by a SQL string literal. + * @param expected the expected Java identifier + * @return an Optional with the text of SQL String literal if present; otherwise an empty Optional + * @throws IOException If an I/O error occurs + */ + private Optional readIdentFollowedByLiteral(String expected) throws IOException { + Optional optIdent = readIdentifier(); + if (optIdent.isPresent()) { + String ident = optIdent.get(); + if (ident.equalsIgnoreCase(expected)) { + Optional optLiteral = readSQLStringLiteral(); + if (optLiteral.isPresent()) { + return optLiteral; + } + } + } + return Optional.empty(); + } + + /** + * Tries to read a Java identifier. + * @return an Optional with the text of the identifier if present; otherwise an empty Optional + * @throws IOException If an I/O error occurs + */ + private Optional readIdentifier() throws IOException { + skipBlanksAndTabs(); + if (Character.isJavaIdentifierStart(this.nextChar)) { + StringBuilder ident = new StringBuilder(); + ident.append((char)this.nextChar); + this.nextChar = this.reader.read(); + while (Character.isJavaIdentifierPart(this.nextChar)) { + ident.append((char)this.nextChar); + this.nextChar = reader.read(); + } + return Optional.of(ident.toString()); + } + return Optional.empty(); + } + + /** + * Tries to read a SQL String literal. + * @return an Optional with the text of the SQL String literal if present; otherwise an empty Optional + * @throws IOException If an I/O error occurs + */ + private Optional readSQLStringLiteral() throws IOException { + skipBlanksAndTabs(); + if (this.nextChar == '\'') { + StringBuilder literal = new StringBuilder(); + this.nextChar = this.reader.read(); + while (this.nextChar != -1) { + // possible end of SQL String literal + if (this.nextChar == '\'') { + this.nextChar = this.reader.read(); + // are there two single quotes? + if (this.nextChar == '\'') { + // yes -> append one ' and continue + literal.append('\''); + } else { + // found end of literal + break; + } + } else { + literal.append((char)this.nextChar); + this.nextChar = this.reader.read(); + } + } + return Optional.of(literal.toString()); + } + return Optional.empty(); + } + + /** + * Skips any whitespace characters. + * The variable nextChar holds the first non whitespace char. + * @throws IOException If an I/O error occurs + */ + private void skipWhitespaces() throws IOException { + while (Character.isWhitespace(this.nextChar)) { + this.nextChar = this.reader.read(); + } + } + + /** + * Skips any blank and tab characters. + * The variable nextChar holds the first non blank or tab char. + * @throws IOException If an I/O error occurs + */ + private void skipBlanksAndTabs() throws IOException { + while (this.nextChar == ' ' || this.nextChar == '\t') { + this.nextChar = this.reader.read(); + } + } + + /** + * Skips to the end of the current line. + * The newline char is consumed. + * The variable nextChar holds the first char of the next line. + * @throws IOException If an I/O error occurs + */ + private void skipToEOL() throws IOException { + while (this.nextChar != -1) { + if (this.nextChar == '\n') { + break; + } + this.nextChar = this.reader.read(); + } + this.nextChar = this.reader.read(); + } + + /** + * Skips to the end of a multi line comment. + * Any characters up to * followed by / are consumed. + * The variable nextChar holds the first char after the comment. + * @throws IOException If an I/O error occurs + */ + private void skipToEndOfMLComment() throws IOException { + while (this.nextChar != -1) { + if (this.nextChar == '*') { + this.nextChar = this.reader.read(); + if (this.nextChar == '/') { + break; + } + } + this.nextChar = this.reader.read(); + } + this.nextChar = this.reader.read(); + } + + /** + * main method For testing; prints the internal state to System.out. + * @param args + */ + public static void main(String[] args) { + for (String arg : args) { + try { + SQLFileLoader loader = new SQLFileLoader(arg); + List stmts = loader.getStatements(); + System.out.println(loader.getConnect()); + System.out.println(loader.getUser()); + System.out.println(loader.getPassword()); + stmts.forEach(System.out::println); + } catch (IOException ex) { + System.err.println(ex); + } + } + } + +} Index: exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java =================================================================== --- exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java (revision 1831198) +++ exectck/src/main/java/org/apache/jdo/exectck/InstallSchema.java (working copy) @@ -20,8 +20,14 @@ import java.io.File; import java.io.IOException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; import java.util.Collection; import java.util.HashSet; +import java.util.List; /** * Goal that installs a database schema for testing a JDO implementation. @@ -87,96 +93,168 @@ + File.separator + "security.policy"); for (String db : dbs) { - if ("derby".equalsIgnoreCase(db)) { - // Currently we support only derby. To support additional db's, configuration - // data must be parameterized. + // Create directory for db logs + String dbLogsDirName = logsDirectory + File.separator + "database"; + File dbLogsDir = new File(dbLogsDirName); + if (!(dbLogsDir.exists()) && !(dbLogsDir.mkdirs())) { + throw new MojoExecutionException("Failed to create directory " + dbLogsDir); + } - // Create directory for db logs - String dbLogsDirName = logsDirectory + File.separator + "database"; - File dbLogsDir = new File(dbLogsDirName); - if (!(dbLogsDir.exists()) && !(dbLogsDir.mkdirs())) { - throw new MojoExecutionException("Failed to create directory " - + dbLogsDir); - } + // Create database directory + String dbDirName = buildDirectory + File.separator + "database" + + File.separator + db; + File dbDir = new File(dbDirName); + if (!(dbDir.exists()) && !(dbDir.mkdirs())) { + throw new MojoExecutionException("Failed to create directory " + dbDir); + } - // Create database directory - String dbDirName = buildDirectory + File.separator + "database" - + File.separator + db; - File dbDir = new File(dbDirName); - if (!(dbDir.exists()) && !(dbDir.mkdirs())) { - throw new MojoExecutionException("Failed to create directory " - + dbDir); - } + // Copy db.properties to db dir + File dbConf = new File(confDirectory + File.separator + db + + ".properties"); + try { + FileUtils.copyFileToDirectory(dbConf, dbDir, false); + } catch (IOException ex) { + throw new MojoExecutionException("Failed to copy file " + dbConf + + " to " + dbDir + ": " + ex.getLocalizedMessage()); + } - // Copy derby.properties to db dir - File dbConf = new File(confDirectory + File.separator + db - + ".properties"); - File targetDir = new File(dbDirName); - try { - FileUtils.copyFileToDirectory(dbConf, targetDir, false); - } catch (IOException ex) { - throw new MojoExecutionException("Failed to copy file " + dbConf - + " to " + dbDir + ": " + ex.getLocalizedMessage()); - } + if (mappings.contains("0")) { + // If schema was explicitly specified as "0" change to "" since + // the schema file in that case is "schema.sql". Note that this + // removes a duplicate entry too + mappings.remove("0"); + mappings.add(""); + } - if (mappings.contains("0")) { - // If schema was explicitly specified as "0" change to "" since - // the schema file in that case is "schema.sql". Note that this - // removes a duplicate entry too - mappings.remove("0"); - mappings.add(""); + initializeDB(db, dbDirName); + + // Create database + for (String idtype : idtypes) { + for (String mapping : mappings) { + System.out.print("*> Installing schema" + mapping + + ".sql for " + db + " " + idtype + " ... "); + + String outFileName = logsDirectory + File.separator + "database" + + File.separator + db + "_" + idtype + "_" + mapping + ".txt"; + String sqlFileName = sqlDirectory + File.separator + db + + File.separator + idtype + File.separator + + "schema" + mapping + ".sql"; + + boolean success = true; + try { + loadSQLFileUsingJDBC(db, dbDirName, sqlFileName, outFileName); + } catch (Exception ex) { + success = false; + System.out.println("FAILED!"); + ex.printStackTrace(); + System.out.println("*> Classpath is "); + new Utilities().printClasspath(); + System.out.println("*> jdo.tck.basedir is \n " + + System.getProperty("jdo.tck.basedir")); + System.out.println("*> java.security.manager is \n " + + System.getProperty("java.security.manager")); + System.out.println("*> java.security.policy is \n " + + System.getProperty("java.security.policy")); + System.out.println("*> dbDirName is \n " + dbDirName); + System.out.println("*> outFileName is \n " + outFileName); + } finally { + if (success) { + System.out.println("done"); + } + } } + } - // Create database - for (String idtype : idtypes) { - for (String mapping : mappings) { - System.setProperty("ij.outfile", logsDirectory + File.separator - + "database" + File.separator + db + "_" + idtype - + "_" + mapping + ".txt"); + finalizeDB(db, dbDirName); - System.out.print("*> Installing schema" + mapping - + ".sql for " + db + " " + idtype + " ... "); + System.out.println("*> See diagnostic output in " + dbLogsDir + "."); + System.out.println(""); + } + } - String[] args = {sqlDirectory + File.separator + db - + File.separator + idtype + File.separator - + "schema" + mapping + ".sql"}; - System.setProperty("derby.system.home", dbDirName); + /** + * + * @param db + * @param dbDirName + */ + protected void initializeDB(String db, String dbDirName) { + if ("derby".equalsIgnoreCase(db)) { + System.setProperty("derby.system.home", dbDirName); + } + } - boolean success = true; - try { - org.apache.derby.tools.ij.main(args); - } catch (IOException ioex) { - success = false; - System.out.println("FAILED!"); - throw new MojoExecutionException( - "*> Failed to execute ij: " + - ioex.getLocalizedMessage()); - } catch (Exception ex) { - success = false; - System.out.println("FAILED!"); - ex.printStackTrace(); - System.out.println("*> Classpath is "); - new Utilities().printClasspath(); - System.out.println("*> derby.system.home is \n " - + System.getProperty("derby.system.home")); - System.out.println("*> jdo.tck.basedir is \n " - + System.getProperty("jdo.tck.basedir")); - System.out.println("*> ij.outfile is \n " - + System.getProperty("ij.outfile")); - System.out.println("*> java.security.manager is \n " - + System.getProperty("java.security.manager")); - System.out.println("*> java.security.policy is \n " - + System.getProperty("java.security.policy")); - } finally { - if (success) { - System.out.println("done"); - } - } + /** + * + * @param db + * @param dbDirName + */ + protected void finalizeDB(String db, String dbDirName) { + if ("derby".equalsIgnoreCase(db)) { + try { + DriverManager.getConnection("jdbc:derby:;shutdown=true"); + } catch (SQLException ex) { + // ignore + } + } + } + + /** + * + * @param dbDirName + * @param sqlFileName + * @param outFileName + * @throws MojoExecutionException + */ + protected void loadSQLFileUsingIJ(String db, String dbDirName, String sqlFileName, String outFileName) + throws MojoExecutionException { + String[] args = {sqlFileName}; + try { + System.setProperty("ij.outfile", outFileName); + org.apache.derby.tools.ij.main(args); + } catch (IOException ioex) { + System.out.println("FAILED!"); + throw new MojoExecutionException( + "*> Failed to execute ij: " + ioex.getLocalizedMessage()); + } + } + + /** + * + * @param dbDirName + * @param sqlFileName + * @param outFileName + * @throws MojoExecutionException + */ + protected void loadSQLFileUsingJDBC(String db, String dbDirName, + String sqlFileName, String outFileName) + throws MojoExecutionException { + try { + SQLFileLoader loader = new SQLFileLoader(sqlFileName); + String url = loader.getConnect(); + String user = loader.getUser(); + String passwd = loader.getPassword(); + List stmts = loader.getStatements(); + try (Connection conn = DriverManager.getConnection(url, user, passwd); + Statement stmt = conn.createStatement(); + PrintWriter outfile = new PrintWriter(outFileName)) { + outfile.println("url=" + url + " user=" + user + " password=" + passwd); + for (String s : stmts) { + try { + outfile.print("loading: " + s); + stmt.execute(s); + outfile.println(" success"); + } catch (SQLException ex) { + outfile.println(" failure " + ex); } } - System.out.println("*> See diagnostic output in " + dbLogsDir + "."); - System.out.println(""); + } catch (SQLException | IOException ex) { + throw new MojoExecutionException( + "*> Failed to load JDBC statements: " + ex.getLocalizedMessage()); } + } catch (IOException ex) { + throw new MojoExecutionException( + "*> Failed to load file " + sqlFileName + " " + ex.getLocalizedMessage()); } } + } Index: tck/src/sql/derby/applicationidentity/schema.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity0; SET SCHEMA applicationidentity0; @@ -10248,4 +10248,4 @@ CONSTRAINT LIFECYCLE_STORE_PK PRIMARY KEY (ID) ); -disconnect; +-- disconnect; Index: tck/src/sql/derby/applicationidentity/schema1.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema1.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema1.sql (working copy) @@ -21,7 +21,7 @@ -- See tables "persons", "employees", "parttimeemployees", -- "fulltimeemployees", "insuranceplans", "medicalinsurance", and "dentalinsurance". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity1; SET SCHEMA applicationidentity1; @@ -266,4 +266,4 @@ ALTER TABLE FIELDSOFENUMORDINAL ADD CONSTRAINT FIELDSOFENUMORDINAL_PK PRIMARY KEY (IDENTIFIER); -disconnect; +-- disconnect; Index: tck/src/sql/derby/applicationidentity/schema10.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema10.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema10.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity10; SET SCHEMA applicationidentity10; Index: tck/src/sql/derby/applicationidentity/schema11.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema11.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema11.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity11; SET SCHEMA applicationidentity11; Index: tck/src/sql/derby/applicationidentity/schema12.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema12.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema12.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity12; SET SCHEMA applicationidentity12; Index: tck/src/sql/derby/applicationidentity/schema2.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema2.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema2.sql (working copy) @@ -29,7 +29,7 @@ -- "fulltimeemployees", "medicalinsurance", "dentalinsurance", -- "fulltime_employee_phoneno_type", and "parttime_employee_phoneno_type". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity2; SET SCHEMA applicationidentity2; @@ -214,4 +214,4 @@ ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES fulltimeemployees(PERSONID) ON DELETE SET NULL; -disconnect; +-- disconnect; Index: tck/src/sql/derby/applicationidentity/schema3.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema3.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema3.sql (working copy) @@ -24,7 +24,7 @@ -- See tables "persons", "parttimeemployees", "fulltimeemployees", -- "medicalinsurance" and "dentalinsurance". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity3; SET SCHEMA applicationidentity3; @@ -177,4 +177,4 @@ ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; -disconnect; +-- disconnect; Index: tck/src/sql/derby/applicationidentity/schema4.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema4.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema4.sql (working copy) @@ -21,7 +21,7 @@ -- have inheritance strategy "superclass-table". -- See tables "persons", "employees", and "insuranceplans". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity4; SET SCHEMA applicationidentity4; @@ -154,4 +154,4 @@ ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons(PERSONID) ON DELETE SET NULL; -disconnect; +-- disconnect; Index: tck/src/sql/derby/applicationidentity/schema5.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema5.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema5.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity orm -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity_orm; SET SCHEMA applicationidentity_orm; Index: tck/src/sql/derby/applicationidentity/schema6.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema6.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema6.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity pkg -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity_pkg; SET SCHEMA applicationidentity_pkg; Index: tck/src/sql/derby/applicationidentity/schema7.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema7.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema7.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity cls -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity_cls; SET SCHEMA applicationidentity_cls; Index: tck/src/sql/derby/applicationidentity/schema8.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema8.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema8.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity8; SET SCHEMA applicationidentity8; Index: tck/src/sql/derby/applicationidentity/schema9.sql =================================================================== --- tck/src/sql/derby/applicationidentity/schema9.sql (revision 1831198) +++ tck/src/sql/derby/applicationidentity/schema9.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: application identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA applicationidentity9; SET SCHEMA applicationidentity9; Index: tck/src/sql/derby/datastoreidentity/schema.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity0; SET SCHEMA datastoreidentity0; @@ -10249,4 +10249,4 @@ CONSTRAINT LIFECYCLE_STORE_PK PRIMARY KEY (DATASTORE_IDENTITY) ); -disconnect; +-- disconnect; Index: tck/src/sql/derby/datastoreidentity/schema1.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema1.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema1.sql (working copy) @@ -21,7 +21,7 @@ -- See tables "persons", "employees", "parttimeemployees", -- "fulltimeemployees", "insuranceplans", "medicalinsurance", and "dentalinsurance". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity1; SET SCHEMA datastoreidentity1; @@ -304,4 +304,4 @@ ALTER TABLE FIELDSOFENUMORDINAL ADD CONSTRAINT FIELDSOFENUMORDINAL_PK PRIMARY KEY (DATASTORE_IDENTITY); -disconnect; +-- disconnect; Index: tck/src/sql/derby/datastoreidentity/schema10.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema10.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema10.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity10; SET SCHEMA datastoreidentity10; Index: tck/src/sql/derby/datastoreidentity/schema11.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema11.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema11.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity11; SET SCHEMA datastoreidentity11; @@ -175,4 +175,4 @@ ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons ON DELETE SET NULL; -disconnect; +-- disconnect; Index: tck/src/sql/derby/datastoreidentity/schema12.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema12.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema12.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity12; SET SCHEMA datastoreidentity12; Index: tck/src/sql/derby/datastoreidentity/schema2.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema2.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema2.sql (working copy) @@ -29,7 +29,7 @@ -- "fulltimeemployees", "medicalinsurance", "dentalinsurance", -- "fulltime_employee_phoneno_type", and "parttime_employee_phoneno_type". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity2; SET SCHEMA datastoreidentity2; @@ -267,4 +267,4 @@ ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES fulltimeemployees ON DELETE SET NULL; -disconnect; +-- disconnect; Index: tck/src/sql/derby/datastoreidentity/schema3.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema3.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema3.sql (working copy) @@ -24,7 +24,7 @@ -- See tables "persons", "parttimeemployees", "fulltimeemployees", -- "medicalinsurance" and "dentalinsurance". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity3; SET SCHEMA datastoreidentity3; @@ -224,4 +224,4 @@ ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons ON DELETE SET NULL; -disconnect; +-- disconnect; Index: tck/src/sql/derby/datastoreidentity/schema4.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema4.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema4.sql (working copy) @@ -21,7 +21,7 @@ -- have inheritance strategy "superclass-table". -- See tables "persons", "employees", and "insuranceplans". -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity4; SET SCHEMA datastoreidentity4; @@ -187,4 +187,4 @@ ADD CONSTRAINT EMP_MO_FK FOREIGN KEY (EMP_OF_THE_MONTH) REFERENCES persons ON DELETE SET NULL; -disconnect; +-- disconnect; Index: tck/src/sql/derby/datastoreidentity/schema5.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema5.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema5.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity orm -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity_orm; SET SCHEMA datastoreidentity_orm; Index: tck/src/sql/derby/datastoreidentity/schema6.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema6.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema6.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity pkg -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity_pkg; SET SCHEMA datastoreidentity_pkg; Index: tck/src/sql/derby/datastoreidentity/schema7.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema7.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema7.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity cls -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity_cls; SET SCHEMA datastoreidentity_cls; Index: tck/src/sql/derby/datastoreidentity/schema8.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema8.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema8.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity8; SET SCHEMA datastoreidentity8; Index: tck/src/sql/derby/datastoreidentity/schema9.sql =================================================================== --- tck/src/sql/derby/datastoreidentity/schema9.sql (revision 1831198) +++ tck/src/sql/derby/datastoreidentity/schema9.sql (working copy) @@ -15,7 +15,7 @@ -- SchemaType: datastore identity -connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; +-- connect 'jdbc:derby:jdotckdb;create=true' user 'tckuser' password 'tckuser'; CREATE SCHEMA datastoreidentity9; SET SCHEMA datastoreidentity9;