sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwens...@apache.org
Subject [1/3] sqoop git commit: SQOOP-2041: Sqoop2: Escape identifier names
Date Tue, 27 Jan 2015 04:25:44 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 5ade862b1 -> 2b4db8023


http://git-wip-us.apache.org/repos/asf/sqoop/blob/2b4db802/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaInsertUpdateDeleteSelectQuery.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaInsertUpdateDeleteSelectQuery.java b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaInsertUpdateDeleteSelectQuery.java
index af76a17..ce7b6cb 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaInsertUpdateDeleteSelectQuery.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaInsertUpdateDeleteSelectQuery.java
@@ -17,6 +17,9 @@
  */
 package org.apache.sqoop.repository.derby;
 
+import org.apache.sqoop.repository.common.CommonRepoUtils;
+import org.apache.sqoop.repository.common.CommonRepositoryInsertUpdateDeleteSelectQuery;
+
 import static org.apache.sqoop.repository.common.CommonRepositorySchemaConstants.*;
 import static org.apache.sqoop.repository.derby.DerbySchemaConstants.*;
 
@@ -25,33 +28,33 @@ import static org.apache.sqoop.repository.derby.DerbySchemaConstants.*;
  * Derby Repository Insert/ Update/ Delete / Select queries
  *
  */
-public final class DerbySchemaInsertUpdateDeleteSelectQuery {
+public final class DerbySchemaInsertUpdateDeleteSelectQuery extends CommonRepositoryInsertUpdateDeleteSelectQuery {
 
   /******** SYSTEM TABLE**************/
   // DML: Get system key
   public static final String STMT_SELECT_SYSTEM =
     "SELECT "
-    + COLUMN_SQM_VALUE
-    + " FROM " + TABLE_SQ_SYSTEM
-    + " WHERE " + COLUMN_SQM_KEY + " = ?";
+    + CommonRepoUtils.escapeColumnName(COLUMN_SQM_VALUE)
+    + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME)
+    + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + " = ?";
 
   //DML: Get deprecated or the new repo version system key
   public static final String STMT_SELECT_DEPRECATED_OR_NEW_SYSTEM_VERSION =
     "SELECT "
-    + COLUMN_SQM_VALUE + " FROM " + TABLE_SQ_SYSTEM
-    + " WHERE ( " + COLUMN_SQM_KEY + " = ? )"
-    + " OR  (" + COLUMN_SQM_KEY + " = ? )";
+    + CommonRepoUtils.escapeColumnName(COLUMN_SQM_VALUE) + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME)
+    + " WHERE ( " + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + " = ? )"
+    + " OR  (" + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + " = ? )";
 
   // DML: Remove system key
   public static final String STMT_DELETE_SYSTEM =
-    "DELETE FROM "  + TABLE_SQ_SYSTEM
-    + " WHERE " + COLUMN_SQM_KEY + " = ?";
+    "DELETE FROM "  + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME)
+    + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + " = ?";
 
   // DML: Insert new system key
   public static final String STMT_INSERT_SYSTEM =
-    "INSERT INTO " + TABLE_SQ_SYSTEM + "("
-    + COLUMN_SQM_KEY + ", "
-    + COLUMN_SQM_VALUE + ") "
+    "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME) + "("
+    + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + ", "
+    + CommonRepoUtils.escapeColumnName(COLUMN_SQM_VALUE) + ") "
     + "VALUES(?, ?)";
 
   /*********CONFIGURABLE TABLE ***************/
@@ -59,41 +62,41 @@ public final class DerbySchemaInsertUpdateDeleteSelectQuery {
   @Deprecated // used only for upgrade logic
   public static final String STMT_SELECT_CONNECTOR_ALL =
      "SELECT "
-     + COLUMN_SQC_ID + ", "
-     + COLUMN_SQC_NAME + ", "
-     + COLUMN_SQC_CLASS + ", "
-     + COLUMN_SQC_VERSION
-     + " FROM " + TABLE_SQ_CONNECTOR;
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQC_CLASS) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQC_VERSION)
+     + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_NAME);
 
    @Deprecated // used only in the upgrade path
    public static final String STMT_INSERT_INTO_CONNECTOR_WITHOUT_SUPPORTED_DIRECTIONS =
-      "INSERT INTO " + TABLE_SQ_CONNECTOR+ " ("
-          + COLUMN_SQC_NAME + ", "
-          + COLUMN_SQC_CLASS + ", "
-          + COLUMN_SQC_VERSION
+      "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_NAME)+ " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_CLASS) + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_VERSION)
           + ") VALUES (?, ?, ?)";
 
   //DML: Insert new connection
   @Deprecated // used only in upgrade path
   public static final String STMT_INSERT_CONNECTION =
-    "INSERT INTO " + TABLE_SQ_CONNECTION + " ("
-     + COLUMN_SQN_NAME + ", "
-     + COLUMN_SQN_CONNECTOR + ","
-     + COLUMN_SQN_ENABLED + ", "
-     + COLUMN_SQN_CREATION_USER + ", "
-     + COLUMN_SQN_CREATION_DATE + ", "
-     + COLUMN_SQN_UPDATE_USER + ", " + COLUMN_SQN_UPDATE_DATE
+    "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_NAME) + " ("
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQN_NAME) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQN_CONNECTOR) + ","
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQN_ENABLED) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQN_CREATION_USER) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQN_CREATION_DATE) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQN_UPDATE_USER) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQN_UPDATE_DATE)
      + ") VALUES (?, ?, ?, ?, ?, ?, ?)";
 
   /******* CONFIG and CONNECTOR DIRECTIONS ****/
-  public static final String STMT_INSERT_DIRECTION = "INSERT INTO " + TABLE_SQ_DIRECTION + " "
-       + "(" + COLUMN_SQD_NAME + ") VALUES (?)";
+  public static final String STMT_INSERT_DIRECTION = "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_DIRECTION_NAME) + " "
+       + "(" + CommonRepoUtils.escapeColumnName(COLUMN_SQD_NAME) + ") VALUES (?)";
 
   public static final String STMT_FETCH_CONFIG_DIRECTIONS =
        "SELECT "
-           + COLUMN_SQ_CFG_ID + ", "
-           + COLUMN_SQ_CFG_DIRECTION
-           + " FROM " + TABLE_SQ_CONFIG;
+           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID) + ", "
+           + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIRECTION)
+           + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME);
 
   private DerbySchemaInsertUpdateDeleteSelectQuery() {
     // Disable explicit object creation

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2b4db802/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java
index d5cabd0..fa6710b 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaUpgradeQuery.java
@@ -17,6 +17,8 @@
  */
 package org.apache.sqoop.repository.derby;
 
+import org.apache.sqoop.repository.common.CommonRepoUtils;
+
 import static org.apache.sqoop.repository.common.CommonRepositorySchemaConstants.*;
 import static org.apache.sqoop.repository.derby.DerbySchemaConstants.*;
 
@@ -39,192 +41,192 @@ public final class DerbySchemaUpgradeQuery {
 
   // DDL: Increased size of SQ_CONNECTOR.SQC_VERSION to 64
   public static final String QUERY_UPGRADE_TABLE_SQ_CONNECTOR_MODIFY_COLUMN_SQC_VERSION_VARCHAR_64 =
-    "ALTER TABLE " + TABLE_SQ_CONNECTOR + " ALTER COLUMN "
-      + COLUMN_SQC_VERSION + " SET DATA TYPE VARCHAR(64)";
+    "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_NAME) + " ALTER COLUMN "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQC_VERSION) + " SET DATA TYPE VARCHAR(64)";
 
   // DDL: Add creation_user column to table SQ_SUBMISSION
   public static final String QUERY_UPGRADE_TABLE_SQ_SUBMISSION_ADD_COLUMN_CREATION_USER =
-      "ALTER TABLE " + TABLE_SQ_SUBMISSION + " ADD "
-      + COLUMN_SQS_CREATION_USER + " VARCHAR(32) "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQS_CREATION_USER) + " VARCHAR(32) "
       + "DEFAULT NULL";
 
   // DDL: Add update_user column to table SQ_SUBMISSION
   public static final String QUERY_UPGRADE_TABLE_SQ_SUBMISSION_ADD_COLUMN_UPDATE_USER =
-      "ALTER TABLE " + TABLE_SQ_SUBMISSION + " ADD "
-      + COLUMN_SQS_UPDATE_USER + " VARCHAR(32) "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQS_UPDATE_USER) + " VARCHAR(32) "
       + "DEFAULT NULL";
 
   //DDL: Add update_user column to table SQ_SUBMISSION
   public static final String QUERY_UPGRADE_TABLE_SQ_SUBMISSION_MODIFY_COLUMN_SQS_EXTERNAL_ID_VARCHAR_50 =
-     "ALTER TABLE " + TABLE_SQ_SUBMISSION + " ALTER COLUMN "
-     + COLUMN_SQS_EXTERNAL_ID + " SET DATA TYPE VARCHAR(50)";
+     "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) + " ALTER COLUMN "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQS_EXTERNAL_ID) + " SET DATA TYPE VARCHAR(50)";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_CONNECTION_ADD_COLUMN_ENABLED =
-      "ALTER TABLE " + TABLE_SQ_CONNECTION + " ADD "
-      + COLUMN_SQN_ENABLED + " BOOLEAN "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQN_ENABLED) + " BOOLEAN "
       + "DEFAULT TRUE";
 
   // DDL: Add creation_user column to table SQ_CONNECTION
   public static final String QUERY_UPGRADE_TABLE_SQ_CONNECTION_ADD_COLUMN_CREATION_USER =
-      "ALTER TABLE " + TABLE_SQ_CONNECTION + " ADD "
-      + COLUMN_SQN_CREATION_USER + " VARCHAR(32) "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQN_CREATION_USER) + " VARCHAR(32) "
       + "DEFAULT NULL";
 
   // DDL: Add update_user column to table SQ_CONNECTION
   public static final String QUERY_UPGRADE_TABLE_SQ_CONNECTION_ADD_COLUMN_UPDATE_USER =
-      "ALTER TABLE " + TABLE_SQ_CONNECTION + " ADD "
-      + COLUMN_SQN_UPDATE_USER + " VARCHAR(32) "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQN_UPDATE_USER) + " VARCHAR(32) "
       + "DEFAULT NULL";
   // DDL: Add enabled column to table SQ_JOB
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_ADD_COLUMN_ENABLED =
-      "ALTER TABLE " + TABLE_SQ_JOB + " ADD "
-      + COLUMN_SQB_ENABLED + " BOOLEAN "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ENABLED) + " BOOLEAN "
       + "DEFAULT TRUE";
 
   // DDL: Add creation_user column to table SQ_JOB
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_ADD_COLUMN_CREATION_USER =
-      "ALTER TABLE " + TABLE_SQ_JOB + " ADD "
-      + COLUMN_SQB_CREATION_USER + " VARCHAR(32) "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQB_CREATION_USER) + " VARCHAR(32) "
       + "DEFAULT NULL";
 
   // DDL: Add update_user column to table SQ_JOB
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_ADD_COLUMN_UPDATE_USER =
-      "ALTER TABLE " + TABLE_SQ_JOB + " ADD "
-      + COLUMN_SQB_UPDATE_USER + " VARCHAR(32) "
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD "
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQB_UPDATE_USER) + " VARCHAR(32) "
       + "DEFAULT NULL";
 
   // Version 4 Upgrade
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_RENAME_COLUMN_SQB_CONNECTION_TO_SQB_FROM_CONNECTION =
-      "RENAME COLUMN " + TABLE_SQ_JOB + "." + COLUMN_SQB_CONNECTION
-        + " TO " + COLUMN_SQB_FROM_CONNECTION;
+      "RENAME COLUMN " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQB_CONNECTION)
+        + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_CONNECTION);
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_ADD_COLUMN_SQB_TO_CONNECTION =
-      "ALTER TABLE " + TABLE_SQ_JOB + " ADD COLUMN " + COLUMN_SQB_TO_CONNECTION
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD COLUMN " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_CONNECTION)
         + " BIGINT";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_REMOVE_CONSTRAINT_SQB_SQN =
-      "ALTER TABLE " + TABLE_SQ_JOB + " DROP CONSTRAINT " + CONSTRAINT_SQB_SQN;
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQB_SQN;
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_ADD_CONSTRAINT_SQB_SQN_FROM =
-      "ALTER TABLE " + TABLE_SQ_JOB + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQN_FROM
-          + " FOREIGN KEY (" + COLUMN_SQB_FROM_CONNECTION + ") REFERENCES "
-          + TABLE_SQ_CONNECTION + " (" + COLUMN_SQN_ID + ")";
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQN_FROM
+          + " FOREIGN KEY (" + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_CONNECTION) + ") REFERENCES "
+          + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_NAME) + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQN_ID) + ")";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_ADD_CONSTRAINT_SQB_SQN_TO =
-      "ALTER TABLE " + TABLE_SQ_JOB + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQN_TO
-        + " FOREIGN KEY (" + COLUMN_SQB_TO_CONNECTION + ") REFERENCES "
-        + TABLE_SQ_CONNECTION + " (" + COLUMN_SQN_ID + ")";
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQN_TO
+        + " FOREIGN KEY (" + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_CONNECTION) + ") REFERENCES "
+        + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_NAME) + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQN_ID) + ")";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_RENAME_COLUMN_SQF_OPERATION_TO_SQF_DIRECTION =
-    "RENAME COLUMN " + TABLE_SQ_FORM + "." + COLUMN_SQF_OPERATION
-      + " TO " + COLUMN_SQF_DIRECTION;
+    "RENAME COLUMN " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_OPERATION)
+      + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION);
 
   //DML: Insert into form
   public static final String STMT_INSERT_INTO_FORM =
-     "INSERT INTO " + TABLE_SQ_FORM+ " ("
-     + COLUMN_SQF_CONNECTOR + ", "
-     + COLUMN_SQF_NAME + ", "
-     + COLUMN_SQF_TYPE + ", "
-     + COLUMN_SQF_INDEX
+     "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME)+ " ("
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQF_CONNECTOR) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQF_TYPE) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQF_INDEX)
      + ") VALUES ( ?, ?, ?, ?)";
 
   // DML: Insert into inpu with form name
   public static final String STMT_INSERT_INTO_INPUT_WITH_FORM =
-     "INSERT INTO " + TABLE_SQ_INPUT + " ("
-     + COLUMN_SQI_NAME + ", "
-     + COLUMN_SQI_FORM + ", "
-     + COLUMN_SQI_INDEX + ", "
-     + COLUMN_SQI_TYPE + ", "
-     + COLUMN_SQI_STRMASK + ", "
-     + COLUMN_SQI_STRLENGTH + ", "
-     + COLUMN_SQI_ENUMVALS
+     "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " ("
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQI_FORM) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQI_INDEX) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQI_TYPE) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQI_STRMASK) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQI_STRLENGTH) + ", "
+     + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ENUMVALS)
      + ") VALUES (?, ?, ?, ?, ?, ?, ?)";
 
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_SQF_OPERATION_TO_SQF_DIRECTION =
-      "UPDATE " + TABLE_SQ_FORM + " SET " + COLUMN_SQF_DIRECTION
-        + "=? WHERE " + COLUMN_SQF_DIRECTION + "=?"
-          + " AND " + COLUMN_SQF_CONNECTOR + " IS NOT NULL";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SET " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION)
+        + "=? WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "=?"
+          + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_CONNECTOR) + " IS NOT NULL";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_CONNECTOR =
-      "UPDATE " + TABLE_SQ_FORM + " SET " + COLUMN_SQF_CONNECTOR + "= ?"
-          + " WHERE " + COLUMN_SQF_CONNECTOR + " IS NULL AND "
-          + COLUMN_SQF_NAME + " IN (?, ?)";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SET " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_CONNECTOR) + "= ?"
+          + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_CONNECTOR) + " IS NULL AND "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + " IN (?, ?)";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_CONNECTOR_HDFS_FORM_NAME =
-      "UPDATE " + TABLE_SQ_FORM + " SET " + COLUMN_SQF_NAME + "= ?"
-        + " WHERE " + COLUMN_SQF_NAME + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SET " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_CONNECTOR_HDFS_FORM_DIRECTION =
-      "UPDATE " + TABLE_SQ_FORM + " SET " + COLUMN_SQF_DIRECTION + "= ?"
-        + " WHERE " + COLUMN_SQF_NAME + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SET " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "= ?"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_UPDATE_SQB_TO_CONNECTION_COPY_SQB_FROM_CONNECTION =
-      "UPDATE " + TABLE_SQ_JOB + " SET "
-        + COLUMN_SQB_TO_CONNECTION + "=" + COLUMN_SQB_FROM_CONNECTION
-        + " WHERE " + COLUMN_SQB_TYPE + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " SET "
+        + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_CONNECTION) + "=" + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_CONNECTION)
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TYPE) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_UPDATE_SQB_FROM_CONNECTION =
-      "UPDATE " + TABLE_SQ_JOB + " SET " + COLUMN_SQB_FROM_CONNECTION + "=?"
-        + " WHERE " + COLUMN_SQB_TYPE + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " SET " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_CONNECTION) + "=?"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TYPE) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_UPDATE_SQB_TO_CONNECTION =
-      "UPDATE " + TABLE_SQ_JOB + " SET " + COLUMN_SQB_TO_CONNECTION + "=?"
-        + " WHERE " + COLUMN_SQB_TYPE + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " SET " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_CONNECTION) + "=?"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TYPE) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_SQF_NAME =
-      "UPDATE " + TABLE_SQ_FORM + " SET "
-          + COLUMN_SQF_NAME + "= ?"
-          + " WHERE " + COLUMN_SQF_NAME + "= ?"
-          + " AND " + COLUMN_SQF_DIRECTION + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SET "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?"
+          + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?"
+          + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "= ?";
 
   // remove "input" from the prefix of the name for hdfs configs
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_TABLE_FROM_JOB_INPUT_NAMES =
-      "UPDATE " + TABLE_SQ_INPUT + " SET "
-          + COLUMN_SQI_NAME + "=("
-          + "? || SUBSTR(" + COLUMN_SQI_NAME + ", 6) )"
-          + " WHERE " + COLUMN_SQI_FORM + " IN ("
-          + " SELECT " + COLUMN_SQF_ID + " FROM " + TABLE_SQ_FORM + " WHERE " + COLUMN_SQF_NAME + "= ?"
-          + " AND " + COLUMN_SQF_DIRECTION + "= ?)";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " SET "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + "=("
+          + "? || SUBSTR(" + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", 6) )"
+          + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_FORM) + " IN ("
+          + " SELECT " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_ID) + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?"
+          + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "= ?)";
 
   // remove output from the prefix of the name for hdfs configs
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_TABLE_TO_JOB_INPUT_NAMES =
-      "UPDATE " + TABLE_SQ_INPUT + " SET "
-          + COLUMN_SQI_NAME + "=("
-          + "? || SUBSTR(" + COLUMN_SQI_NAME + ", 7) )"
-          + " WHERE " + COLUMN_SQI_FORM + " IN ("
-          + " SELECT " + COLUMN_SQF_ID + " FROM " + TABLE_SQ_FORM + " WHERE " + COLUMN_SQF_NAME + "= ?"
-          + " AND " + COLUMN_SQF_DIRECTION + "= ?)";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " SET "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + "=("
+          + "? || SUBSTR(" + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", 7) )"
+          + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_FORM) + " IN ("
+          + " SELECT " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_ID) + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?"
+          + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "= ?)";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_DIRECTION_TO_NULL =
-      "UPDATE " + TABLE_SQ_FORM + " SET "
-        + COLUMN_SQF_DIRECTION + "= NULL"
-        + " WHERE " + COLUMN_SQF_NAME + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SET "
+        + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "= NULL"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?";
 
    /** Intended for force driver creation and its related upgrades*/
 
   public static final String QUERY_UPGRADE_TABLE_SQ_CONFIG_NAME_FOR_DRIVER =
-      "UPDATE " + TABLE_SQ_CONFIG + " SET "
-        + COLUMN_SQ_CFG_NAME + "= ?"
-        + " WHERE " + COLUMN_SQ_CFG_NAME + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + " SET "
+        + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + "= ?"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_CONFIG_CONFIGURABLE_ID_FOR_DRIVER =
-      "UPDATE " + TABLE_SQ_CONFIG + " SET "
-        + COLUMN_SQ_CFG_CONFIGURABLE + "= ?"
-        + " WHERE " + COLUMN_SQ_CFG_NAME + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + " SET "
+        + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + "= ?"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_CONFIG_REMOVE_SECURITY_CONFIG_FOR_DRIVER =
-      "DELETE FROM " + TABLE_SQ_CONFIG
-        + " WHERE " + COLUMN_SQ_CFG_NAME + "= ?";
+      "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME)
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_INPUT_REMOVE_SECURITY_CONFIG_INPUT_FOR_DRIVER =
-      "DELETE FROM " + TABLE_SQ_INPUT
-        + " WHERE " + COLUMN_SQI_NAME + "= ?";
+      "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME)
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_INPUT_UPDATE_CONFIG_INPUT_FOR_DRIVER =
-      "UPDATE " + TABLE_SQ_INPUT + " SET "
-          + COLUMN_SQI_NAME + "= ?"
-          + " WHERE " + COLUMN_SQI_NAME + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " SET "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + "= ?"
+          + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + "= ?";
 
   /**
    * Intended to change SQ_JOB_INPUT.SQBI_INPUT from EXPORT
@@ -233,280 +235,280 @@ public final class DerbySchemaUpgradeQuery {
 
   @Deprecated // only used for upgrade
   public static final String QUERY_SELECT_THROTTLING_FORM_INPUT_IDS =
-      "SELECT SQI." + COLUMN_SQI_ID + " FROM " + TABLE_SQ_INPUT + " SQI"
-          + " INNER JOIN " + TABLE_SQ_FORM + " SQF ON SQI." + COLUMN_SQI_FORM + "=SQF." + COLUMN_SQF_ID
-          + " WHERE SQF." + COLUMN_SQF_NAME + "='throttling' AND SQF." + COLUMN_SQF_DIRECTION + "=?";
+      "SELECT SQI." + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " SQI"
+          + " INNER JOIN " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SQF ON SQI." + CommonRepoUtils.escapeColumnName(COLUMN_SQI_FORM) + "=SQF." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_ID)
+          + " WHERE SQF." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "='throttling' AND SQF." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "=?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_INPUT_UPDATE_THROTTLING_FORM_INPUTS =
-      "UPDATE " + TABLE_SQ_JOB_INPUT + " SQBI SET"
-        + " SQBI." + COLUMN_SQBI_INPUT + "=(" + QUERY_SELECT_THROTTLING_FORM_INPUT_IDS
-          + " AND SQI." + COLUMN_SQI_NAME + "=("
-            + "SELECT SQI2." + COLUMN_SQI_NAME + " FROM " + TABLE_SQ_INPUT + " SQI2"
-            + " WHERE SQI2." + COLUMN_SQI_ID + "=SQBI." + COLUMN_SQBI_INPUT + " FETCH FIRST 1 ROWS ONLY"
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_INPUT_NAME) + " SQBI SET"
+        + " SQBI." + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_INPUT) + "=(" + QUERY_SELECT_THROTTLING_FORM_INPUT_IDS
+          + " AND SQI." + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + "=("
+            + "SELECT SQI2." + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " SQI2"
+            + " WHERE SQI2." + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + "=SQBI." + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_INPUT) + " FETCH FIRST 1 ROWS ONLY"
           +   "))"
-        + "WHERE SQBI." + COLUMN_SQBI_INPUT + " IN (" + QUERY_SELECT_THROTTLING_FORM_INPUT_IDS + ")";
+        + "WHERE SQBI." + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_INPUT) + " IN (" + QUERY_SELECT_THROTTLING_FORM_INPUT_IDS + ")";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_REMOVE_EXTRA_FORM_INPUTS =
-      "DELETE FROM " + TABLE_SQ_INPUT + " SQI"
-        + " WHERE SQI." + COLUMN_SQI_FORM + " IN ("
-          + "SELECT SQF." + COLUMN_SQF_ID + " FROM " + TABLE_SQ_FORM + " SQF "
-          + " WHERE SQF." + COLUMN_SQF_NAME + "= ?"
-          + " AND SQF." + COLUMN_SQF_DIRECTION + "= ?)";
+      "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " SQI"
+        + " WHERE SQI." + CommonRepoUtils.escapeColumnName(COLUMN_SQI_FORM) + " IN ("
+          + "SELECT SQF." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_ID) + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SQF "
+          + " WHERE SQF." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?"
+          + " AND SQF." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "= ?)";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_REMOVE_EXTRA_DRIVER_FORM =
-      "DELETE FROM " + TABLE_SQ_FORM
-        + " WHERE " + COLUMN_SQF_NAME + "= ?"
-        + " AND " + COLUMN_SQF_DIRECTION + "= ?";
+      "DELETE FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME)
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?"
+        + " AND " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_FORM_UPDATE_DRIVER_INDEX =
-      "UPDATE " + TABLE_SQ_FORM + " SET "
-        + COLUMN_SQF_INDEX + "= ?"
-        + " WHERE " + COLUMN_SQF_NAME + "= ?";
+      "UPDATE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " SET "
+        + CommonRepoUtils.escapeColumnName(COLUMN_SQF_INDEX) + "= ?"
+        + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + "= ?";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_REMOVE_COLUMN_SQB_TYPE =
-      "ALTER TABLE " + TABLE_SQ_JOB + " DROP COLUMN " + COLUMN_SQB_TYPE;
+      "ALTER TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " DROP COLUMN " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TYPE);
 
   // rename upgrades as part of the refactoring SQOOP-1498
   // table rename for CONNECTION-> LINK
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_CONNECTION_CONSTRAINT_1 = "ALTER TABLE "
-      + TABLE_SQ_CONNECTION_INPUT + " DROP CONSTRAINT " + CONSTRAINT_SQNI_SQI;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_INPUT_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQNI_SQI;
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_CONNECTION_CONSTRAINT_2 = "ALTER TABLE "
-      + TABLE_SQ_CONNECTION_INPUT + " DROP CONSTRAINT " + CONSTRAINT_SQNI_SQN;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_INPUT_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQNI_SQN;
 
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_CONNECTION_CONSTRAINT_3 = "ALTER TABLE "
-      + TABLE_SQ_JOB + " DROP CONSTRAINT " + CONSTRAINT_SQB_SQN_FROM;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQB_SQN_FROM;
 
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_CONNECTION_CONSTRAINT_4 = "ALTER TABLE "
-      + TABLE_SQ_JOB + " DROP CONSTRAINT " + CONSTRAINT_SQB_SQN_TO;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQB_SQN_TO;
 
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_TO_SQ_LINK = "RENAME TABLE "
-      + TABLE_SQ_CONNECTION + " TO SQ_LINK";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_NAME) + " TO SQ_LINK";
 
   // column only renames for SQ_CONNECTION
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_1 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_ID + " TO " + COLUMN_SQ_LNK_ID;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_ID) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_2 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_NAME + " TO " + COLUMN_SQ_LNK_NAME;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_NAME) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_3 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_CONNECTOR + " TO " + COLUMN_SQ_LNK_CONNECTOR;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_CONNECTOR) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONNECTOR);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_4 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_CREATION_USER + " TO " + COLUMN_SQ_LNK_CREATION_USER;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_CREATION_USER) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CREATION_USER);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_5 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_CREATION_DATE + " TO " + COLUMN_SQ_LNK_CREATION_DATE;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_CREATION_DATE) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CREATION_DATE);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_6 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_UPDATE_USER + " TO " + COLUMN_SQ_LNK_UPDATE_USER;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_UPDATE_USER) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_UPDATE_USER);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_7 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_UPDATE_DATE + " TO " + COLUMN_SQ_LNK_UPDATE_DATE;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_UPDATE_DATE) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_UPDATE_DATE);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_COLUMN_8 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQN_ENABLED + " TO " + COLUMN_SQ_LNK_ENABLED;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQN_ENABLED) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ENABLED);
 
   // rename the constraint CONSTRAINT_SQF_SQC to CONSTRAINT_SQ_CFG_SQC
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_CONNECTION_CONNECTOR_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_LINK + " DROP CONSTRAINT " + CONSTRAINT_SQN_SQC;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQN_SQC;
 
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_LINK_CONNECTOR_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_LINK + " ADD CONSTRAINT " + CONSTRAINT_SQ_LNK_SQC + " " + "FOREIGN KEY ("
-      + COLUMN_SQ_LNK_CONNECTOR + ") " + "REFERENCES " + TABLE_SQ_CONNECTOR + " (" + COLUMN_SQC_ID
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQ_LNK_SQC + " " + "FOREIGN KEY ("
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONNECTOR) + ") " + "REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_NAME) + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID)
       + ")";
 
   // table rename for CONNECTION_INPUT -> LINK_INPUT
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_INPUT_TO_SQ_LINK_INPUT = "RENAME TABLE "
-      + TABLE_SQ_CONNECTION_INPUT + " TO SQ_LINK_INPUT";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTION_INPUT_NAME) + " TO SQ_LINK_INPUT";
   // column renames for SQ_CONNECTION_INPUT
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_INPUT_COLUMN_1 = "RENAME COLUMN "
-      + TABLE_SQ_LINK_INPUT + "." + COLUMN_SQNI_CONNECTION + " TO " + COLUMN_SQ_LNKI_LINK;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQNI_CONNECTION) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_LINK);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_INPUT_COLUMN_2 = "RENAME COLUMN "
-      + TABLE_SQ_LINK_INPUT + "." + COLUMN_SQNI_INPUT + " TO " + COLUMN_SQ_LNKI_INPUT;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQNI_INPUT) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_INPUT);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTION_INPUT_COLUMN_3 = "RENAME COLUMN "
-      + TABLE_SQ_LINK_INPUT + "." + COLUMN_SQNI_VALUE + " TO " + COLUMN_SQ_LNKI_VALUE;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQNI_VALUE) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_VALUE);
   // add the dropped LINK table constraint to the LINK_INPUT
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_LINK_INPUT_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_LINK_INPUT + " ADD CONSTRAINT " + CONSTRAINT_SQ_LNKI_SQ_LNK + " "
-      + "FOREIGN KEY (" + COLUMN_SQ_LNKI_LINK + ") " + "REFERENCES " + TABLE_SQ_LINK + " ("
-      + COLUMN_SQ_LNK_ID + ")";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQ_LNKI_SQ_LNK + " "
+      + "FOREIGN KEY (" + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_LINK) + ") " + "REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " ("
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ")";
 
   // table rename for FORM-> CONFIG
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_FORM_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_INPUT + " DROP CONSTRAINT " + CONSTRAINT_SQI_SQF;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQI_SQF;
 
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_FORM_TO_SQ_CONFIG = "RENAME TABLE "
-      + TABLE_SQ_FORM + " TO SQ_CONFIG";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_FORM_NAME) + " TO SQ_CONFIG";
 
   // column and constraint renames for SQ_FORM
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_FORM_COLUMN_1 = "RENAME COLUMN "
-      + TABLE_SQ_CONFIG + "." + COLUMN_SQF_ID + " TO " + COLUMN_SQ_CFG_ID;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_ID) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_FORM_COLUMN_2 = "RENAME COLUMN "
-      + TABLE_SQ_CONFIG + "." + COLUMN_SQF_CONNECTOR + " TO " + COLUMN_SQ_CFG_CONNECTOR;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_CONNECTOR) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONNECTOR);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_FORM_COLUMN_3 = "RENAME COLUMN "
-      + TABLE_SQ_CONFIG + "." + COLUMN_SQF_DIRECTION + " TO " + COLUMN_SQ_CFG_DIRECTION;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_DIRECTION) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIRECTION);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_FORM_COLUMN_4 = "RENAME COLUMN "
-      + TABLE_SQ_CONFIG + "." + COLUMN_SQF_NAME + " TO " + COLUMN_SQ_CFG_NAME;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_NAME) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_FORM_COLUMN_5 = "RENAME COLUMN "
-      + TABLE_SQ_CONFIG + "." + COLUMN_SQF_TYPE + " TO " + COLUMN_SQ_CFG_TYPE;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_TYPE) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_TYPE);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_FORM_COLUMN_6 = "RENAME COLUMN "
-      + TABLE_SQ_CONFIG + "." + COLUMN_SQF_INDEX + " TO " + COLUMN_SQ_CFG_INDEX;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQF_INDEX) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_INDEX);
 
   // rename the constraint CONSTRAINT_SQF_SQC to CONSTRAINT_SQ_CFG_SQC
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_FORM_CONNECTOR_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_CONFIG + " DROP CONSTRAINT " + CONSTRAINT_SQF_SQC;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQF_SQC;
 
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_CONFIG_CONNECTOR_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_CONFIG
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQ_CFG_SQC
       + " "
       + "FOREIGN KEY ("
-      + COLUMN_SQ_CFG_CONNECTOR
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONNECTOR)
       + ") "
       + "REFERENCES "
-      + TABLE_SQ_CONNECTOR
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_NAME)
       + " ("
-      + COLUMN_SQC_ID
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID)
       + ")";
 
   // column rename and constraint add for SQ_INPUT
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_INPUT_FORM_COLUMN = "RENAME COLUMN "
-      + TABLE_SQ_INPUT + "." + COLUMN_SQI_FORM + " TO " + COLUMN_SQI_CONFIG;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQI_FORM) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_CONFIG);
 
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_INPUT_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_INPUT + " ADD CONSTRAINT " + CONSTRAINT_SQI_SQ_CFG + " " + "FOREIGN KEY ("
-      + COLUMN_SQI_CONFIG + ") " + "REFERENCES " + TABLE_SQ_CONFIG + " (" + COLUMN_SQ_CFG_ID + ")";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQI_SQ_CFG + " " + "FOREIGN KEY ("
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQI_CONFIG) + ") " + "REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID) + ")";
 
   // column rename and constraint add for SQ_JOB ( from and to link)
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_JOB_COLUMN_1 = "RENAME COLUMN "
-      + TABLE_SQ_JOB + "." + COLUMN_SQB_FROM_CONNECTION + " TO " + COLUMN_SQB_FROM_LINK;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_CONNECTION) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_LINK);
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_JOB_COLUMN_2 = "RENAME COLUMN "
-      + TABLE_SQ_JOB + "." + COLUMN_SQB_TO_CONNECTION + " TO " + COLUMN_SQB_TO_LINK;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_CONNECTION) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_LINK);
 
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_JOB_CONSTRAINT_FROM = "ALTER TABLE "
-      + TABLE_SQ_JOB + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQ_LNK_FROM + " FOREIGN KEY ("
-      + COLUMN_SQB_FROM_LINK + ") REFERENCES " + TABLE_SQ_LINK + " (" + COLUMN_SQ_LNK_ID + ")";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQ_LNK_FROM + " FOREIGN KEY ("
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_LINK) + ") REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ")";
 
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_JOB_CONSTRAINT_TO = "ALTER TABLE "
-      + TABLE_SQ_JOB + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQ_LNK_TO + " FOREIGN KEY ("
-      + COLUMN_SQB_TO_LINK + ") REFERENCES " + TABLE_SQ_LINK + " (" + COLUMN_SQ_LNK_ID + ")";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQB_SQ_LNK_TO + " FOREIGN KEY ("
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_LINK) + ") REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ")";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_JOB_ADD_UNIQUE_CONSTRAINT_NAME = "ALTER TABLE "
-      + TABLE_SQ_JOB + " ADD CONSTRAINT " + CONSTRAINT_SQB_NAME_UNIQUE + " UNIQUE ("
-      + COLUMN_SQB_NAME + ")";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQB_NAME_UNIQUE + " UNIQUE ("
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQB_NAME) + ")";
 
   public static final String QUERY_UPGRADE_TABLE_SQ_LINK_ADD_UNIQUE_CONSTRAINT_NAME = "ALTER TABLE "
-      + TABLE_SQ_LINK
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQ_LNK_NAME_UNIQUE
       + " UNIQUE ("
-      + COLUMN_SQ_LNK_NAME + ")";
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME) + ")";
 
   // SQOOP-1557 upgrade queries for table rename for CONNECTOR-> CONFIGURABLE
 
   // drop the SQ_CONFIG FK for connector table
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_CONFIG_CONNECTOR_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_CONFIG + " DROP CONSTRAINT " + CONSTRAINT_SQ_CFG_SQC;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQ_CFG_SQC;
 
   // drop the SQ_LINK FK for connector table
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_LINK_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_LINK + " DROP CONSTRAINT " + CONSTRAINT_SQ_LNK_SQC;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQ_LNK_SQC;
 
   // drop the SQ_CONNECTOR_DIRECTION FK for connector table
   public static final String QUERY_UPGRADE_DROP_TABLE_SQ_CONNECTOR_DIRECTION_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_CONNECTOR_DIRECTIONS + " DROP CONSTRAINT " + CONSTRAINT_SQCD_SQC;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_DIRECTIONS_NAME) + " DROP CONSTRAINT " + CONSTRAINT_SQCD_SQC;
 
   // rename
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONNECTOR_TO_SQ_CONFIGURABLE = "RENAME TABLE "
-      + TABLE_SQ_CONNECTOR + " TO SQ_CONFIGURABLE";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_NAME) + " TO SQ_CONFIGURABLE";
 
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_CONFIG_COLUMN_1 = "RENAME COLUMN "
-      + TABLE_SQ_CONFIG + "." + COLUMN_SQ_CFG_CONNECTOR + " TO " + COLUMN_SQ_CFG_CONFIGURABLE;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONNECTOR) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE);
 
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_LINK_COLUMN_1 = "RENAME COLUMN "
-      + TABLE_SQ_LINK + "." + COLUMN_SQ_LNK_CONNECTOR + " TO " + COLUMN_SQ_LNK_CONFIGURABLE;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONNECTOR) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE);
 
   // add a type column to the configurable
   public static final String QUERY_UPGRADE_TABLE_SQ_CONFIGURABLE_ADD_COLUMN_SQC_TYPE = "ALTER TABLE "
-      + TABLE_SQ_CONFIGURABLE + " ADD COLUMN " + COLUMN_SQC_TYPE + " VARCHAR(32)";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME) + " ADD COLUMN " + CommonRepoUtils.escapeColumnName(COLUMN_SQC_TYPE) + " VARCHAR(32)";
 
   // add the constraints back for SQ_CONFIG
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_CONFIG_CONFIGURABLE_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_CONFIG
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQ_CFG_SQC
       + " "
       + "FOREIGN KEY ("
-      + COLUMN_SQ_CFG_CONFIGURABLE
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE)
       + ") "
       + "REFERENCES "
-      + TABLE_SQ_CONFIGURABLE
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME)
       + " ("
-      + COLUMN_SQC_ID + ")";
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ")";
 
   // add the constraints back for SQ_LINK
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_LINK_CONFIGURABLE_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_LINK
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQ_LNK_SQC
       + " "
       + "FOREIGN KEY ("
-      + COLUMN_SQ_LNK_CONFIGURABLE
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE)
       + ") "
       + "REFERENCES "
-      + TABLE_SQ_CONFIGURABLE
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME)
       + " ("
-      + COLUMN_SQC_ID + ")";
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ")";
 
   // add the constraints back for SQ_CONNECTOR_DIRECTION
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_CONNECTOR_DIRECTION_CONSTRAINT = "ALTER TABLE "
-      + TABLE_SQ_CONNECTOR_DIRECTIONS
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_DIRECTIONS_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQCD_SQC
       + " "
       + "FOREIGN KEY ("
-      + COLUMN_SQCD_CONNECTOR
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_CONNECTOR)
       + ") "
       + "REFERENCES "
-      + TABLE_SQ_CONFIGURABLE
-      + " (" + COLUMN_SQC_ID + ")";
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME)
+      + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ")";
 
  // add the constraints back for SQ_CONNECTOR_DIRECTION
   public static final String QUERY_UPGRADE_ADD_TABLE_SQ_CONNECTOR_DIRECTION_CONFIGURABLE_CONSTRAINT = "ALTER TABLE "
-     + TABLE_SQ_LINK + " ADD CONSTRAINT " + CONSTRAINT_SQCD_SQC + " "
-       + "FOREIGN KEY (" + COLUMN_SQCD_CONNECTOR + ") "
-         + "REFERENCES " + TABLE_SQ_CONFIGURABLE + " (" + COLUMN_SQC_ID + ")";
+     + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " ADD CONSTRAINT " + CONSTRAINT_SQCD_SQC + " "
+       + "FOREIGN KEY (" + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_CONNECTOR) + ") "
+         + "REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME) + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ")";
 
   // upgrade for config and connector-directions
 
   public static final String QUERY_UPGRADE_TABLE_SQ_CONFIG_DROP_COLUMN_SQ_CFG_DIRECTION_VARCHAR = "ALTER TABLE "
-      + TABLE_SQ_CONFIG + " DROP COLUMN " + COLUMN_SQ_CFG_DIRECTION;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + " DROP COLUMN " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIRECTION);
 
   // add unique constraint on the configurable table for name
   public static final String QUERY_UPGRADE_TABLE_SQ_CONFIGURABLE_ADD_UNIQUE_CONSTRAINT_NAME = "ALTER TABLE "
-      + TABLE_SQ_CONFIGURABLE
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQ_CONFIGURABLE_UNIQUE
-      + " UNIQUE (" + COLUMN_SQC_NAME + ")";
+      + " UNIQUE (" + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + ")";
 
   // add unique constraint on the config table for name and type and configurableId
   public static final String QUERY_UPGRADE_TABLE_SQ_CONFIG_ADD_UNIQUE_CONSTRAINT_NAME_TYPE_AND_CONFIGURABLE_ID = "ALTER TABLE "
-      + TABLE_SQ_CONFIG
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQ_CONFIG_UNIQUE
       + " UNIQUE ("
-      + COLUMN_SQ_CFG_NAME + ", " + COLUMN_SQ_CFG_TYPE + ", " + COLUMN_SQ_CFG_CONFIGURABLE + ")";
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_TYPE) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + ")";
 
   // add unique constraint on the input table for name and type and configId
   public static final String QUERY_UPGRADE_TABLE_SQ_INPUT_ADD_UNIQUE_CONSTRAINT_NAME_TYPE_AND_CONFIG_ID = "ALTER TABLE "
-      + TABLE_SQ_INPUT
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME)
       + " ADD CONSTRAINT "
       + CONSTRAINT_SQ_INPUT_UNIQUE
       + " UNIQUE ("
-      + COLUMN_SQI_NAME + ", " + COLUMN_SQI_TYPE + ", " + COLUMN_SQI_CONFIG + ")";
+      + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_TYPE) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_CONFIG) + ")";
 
   // rename exception to error_summary
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_JOB_SUBMISSION_COLUMN_1 = "RENAME COLUMN "
-      + TABLE_SQ_SUBMISSION + "." + COLUMN_SQS_EXCEPTION + " TO " + COLUMN_SQS_ERROR_SUMMARY;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQS_EXCEPTION) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ERROR_SUMMARY);
 
   //rename exception_trace to error_details
   public static final String QUERY_UPGRADE_RENAME_TABLE_SQ_JOB_SUBMISSION_COLUMN_2 = "RENAME COLUMN "
-      + TABLE_SQ_SUBMISSION + "." + COLUMN_SQS_EXCEPTION_TRACE + " TO " + COLUMN_SQS_ERROR_DETAILS;
+      + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) + "." + CommonRepoUtils.escapeColumnName(COLUMN_SQS_EXCEPTION_TRACE) + " TO " + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ERROR_DETAILS);
 
   private DerbySchemaUpgradeQuery() {
     // Disable explicit object creation

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2b4db802/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaCreateQuery.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaCreateQuery.java b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaCreateQuery.java
index 39abb2d..be612ce 100644
--- a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaCreateQuery.java
+++ b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaCreateQuery.java
@@ -17,6 +17,8 @@
  */
 package org.apache.sqoop.repository.postgresql;
 
+import org.apache.sqoop.repository.common.CommonRepoUtils;
+
 import static org.apache.sqoop.repository.postgresql.PostgresqlSchemaConstants.*;
 
 /**
@@ -232,142 +234,142 @@ import static org.apache.sqoop.repository.postgresql.PostgresqlSchemaConstants.*
 public class PostgresqlSchemaCreateQuery {
 
   public static final String QUERY_CREATE_SCHEMA_SQOOP =
-      "CREATE SCHEMA " + SCHEMA_SQOOP;
+      "CREATE SCHEMA " + CommonRepoUtils.escapeSchemaName(SCHEMA_SQOOP);
 
   public static final String QUERY_CREATE_TABLE_SQ_SYSTEM =
-      "CREATE TABLE " + TABLE_SQ_SYSTEM + " ("
-          + COLUMN_SQM_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQM_KEY + " VARCHAR(64), "
-          + COLUMN_SQM_VALUE + " VARCHAR(64) "
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQM_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + " VARCHAR(64), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQM_VALUE) + " VARCHAR(64) "
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_DIRECTION =
-      "CREATE TABLE " + TABLE_SQ_DIRECTION + " ("
-          + COLUMN_SQD_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQD_NAME + " VARCHAR(64)"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_DIRECTION_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQD_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQD_NAME) + " VARCHAR(64)"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_CONFIGURABLE =
-      "CREATE TABLE " + TABLE_SQ_CONFIGURABLE + " ("
-          + COLUMN_SQC_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQC_NAME + " VARCHAR(64) UNIQUE, "
-          + COLUMN_SQC_TYPE + " VARCHAR(32), "
-          + COLUMN_SQC_CLASS + " VARCHAR(255), "
-          + COLUMN_SQC_VERSION + " VARCHAR(64) "
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_NAME) + " VARCHAR(64) UNIQUE, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_TYPE) + " VARCHAR(32), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_CLASS) + " VARCHAR(255), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQC_VERSION) + " VARCHAR(64) "
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_CONNECTOR_DIRECTIONS =
-      "CREATE TABLE " + TABLE_SQ_CONNECTOR_DIRECTIONS + " ("
-          + COLUMN_SQCD_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQCD_CONNECTOR + " BIGINT REFERENCES " + TABLE_SQ_CONFIGURABLE + "("  + COLUMN_SQC_ID + ")" + ", "
-          + COLUMN_SQCD_DIRECTION + " BIGINT REFERENCES " + TABLE_SQ_DIRECTION + "("  + COLUMN_SQD_ID + ")"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONNECTOR_DIRECTIONS_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_CONNECTOR) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQCD_DIRECTION) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_DIRECTION_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQD_ID) + ")"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_CONFIG =
-      "CREATE TABLE " + TABLE_SQ_CONFIG + " ("
-          + COLUMN_SQ_CFG_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQ_CFG_CONFIGURABLE + " BIGINT REFERENCES " + TABLE_SQ_CONFIGURABLE + "("  + COLUMN_SQC_ID + ")" + ", "
-          + COLUMN_SQ_CFG_NAME + " VARCHAR(64), "
-          + COLUMN_SQ_CFG_TYPE + " VARCHAR(32), "
-          + COLUMN_SQ_CFG_INDEX + " SMALLINT, "
-          + "UNIQUE (" + COLUMN_SQ_CFG_NAME + ", " + COLUMN_SQ_CFG_TYPE + ", " + COLUMN_SQ_CFG_CONFIGURABLE + ") "
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + " VARCHAR(64), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_TYPE) + " VARCHAR(32), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_INDEX) + " SMALLINT, "
+          + "UNIQUE (" + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_NAME) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_TYPE) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_CONFIGURABLE) + ") "
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_CONFIG_DIRECTIONS =
-      "CREATE TABLE " + TABLE_SQ_CONFIG_DIRECTIONS + " ("
-          + COLUMN_SQ_CFG_DIR_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQ_CFG_DIR_CONFIG + " BIGINT REFERENCES " + TABLE_SQ_CONFIG + "("  + COLUMN_SQ_CFG_ID + ")" + ", "
-          + COLUMN_SQ_CFG_DIR_DIRECTION + " BIGINT REFERENCES " + TABLE_SQ_DIRECTION + "("  + COLUMN_SQD_ID + ")"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_DIRECTIONS_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_CONFIG) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_DIR_DIRECTION) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_DIRECTION_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQD_ID) + ")"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_INPUT =
-      "CREATE TABLE " + TABLE_SQ_INPUT + " ("
-          + COLUMN_SQI_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQI_NAME + " VARCHAR(64), "
-          + COLUMN_SQI_CONFIG + " BIGINT REFERENCES " + TABLE_SQ_CONFIG + "("  + COLUMN_SQ_CFG_ID + ")" + ", "
-          + COLUMN_SQI_INDEX + " SMALLINT, "
-          + COLUMN_SQI_TYPE + " VARCHAR(32), "
-          + COLUMN_SQI_STRMASK + " BOOLEAN, "
-          + COLUMN_SQI_STRLENGTH + " SMALLINT, "
-          + COLUMN_SQI_ENUMVALS + " VARCHAR(100), "
-          + " UNIQUE (" + COLUMN_SQI_NAME + ", " + COLUMN_SQI_TYPE + ", " + COLUMN_SQI_CONFIG + ") "
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + " VARCHAR(64), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_CONFIG) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIG_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQ_CFG_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_INDEX) + " SMALLINT, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_TYPE) + " VARCHAR(32), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_STRMASK) + " BOOLEAN, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_STRLENGTH) + " SMALLINT, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ENUMVALS) + " VARCHAR(100), "
+          + " UNIQUE (" + CommonRepoUtils.escapeColumnName(COLUMN_SQI_NAME) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_TYPE) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQI_CONFIG) + ") "
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_LINK =
-      "CREATE TABLE " + TABLE_SQ_LINK + " ("
-          + COLUMN_SQ_LNK_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQ_LNK_CONFIGURABLE + " BIGINT REFERENCES " + TABLE_SQ_CONFIGURABLE + "("  + COLUMN_SQC_ID + ")" + ", "
-          + COLUMN_SQ_LNK_NAME  + " VARCHAR(32) UNIQUE, "
-          + COLUMN_SQ_LNK_CREATION_DATE + " TIMESTAMP, "
-          + COLUMN_SQ_LNK_CREATION_USER + " VARCHAR(32) DEFAULT NULL, "
-          + COLUMN_SQ_LNK_UPDATE_DATE + " TIMESTAMP, "
-          + COLUMN_SQ_LNK_UPDATE_USER + " VARCHAR(32) DEFAULT NULL, "
-          + COLUMN_SQ_LNK_ENABLED + " BOOLEAN DEFAULT TRUE"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CONFIGURABLE) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_CONFIGURABLE_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQC_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_NAME)  + " VARCHAR(32) UNIQUE, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CREATION_DATE) + " TIMESTAMP, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_CREATION_USER) + " VARCHAR(32) DEFAULT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_UPDATE_DATE) + " TIMESTAMP, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_UPDATE_USER) + " VARCHAR(32) DEFAULT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ENABLED) + " BOOLEAN DEFAULT TRUE"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_JOB =
-      "CREATE TABLE " + TABLE_SQ_JOB + " ("
-          + COLUMN_SQB_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQB_FROM_LINK + " BIGINT REFERENCES " + TABLE_SQ_LINK + "("  + COLUMN_SQ_LNK_ID + ")" + ", "
-          + COLUMN_SQB_TO_LINK + " BIGINT REFERENCES " + TABLE_SQ_LINK + "("  + COLUMN_SQ_LNK_ID + ")" + ", "
-          + COLUMN_SQB_NAME + " VARCHAR(64) UNIQUE, "
-          + COLUMN_SQB_CREATION_DATE + " TIMESTAMP, "
-          + COLUMN_SQB_CREATION_USER + " VARCHAR(32) DEFAULT NULL, "
-          + COLUMN_SQB_UPDATE_DATE + " TIMESTAMP, "
-          + COLUMN_SQB_UPDATE_USER + " VARCHAR(32) DEFAULT NULL, "
-          + COLUMN_SQB_ENABLED + " BOOLEAN DEFAULT TRUE"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_FROM_LINK) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_TO_LINK) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_NAME) + " VARCHAR(64) UNIQUE, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_CREATION_DATE) + " TIMESTAMP, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_CREATION_USER) + " VARCHAR(32) DEFAULT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_UPDATE_DATE) + " TIMESTAMP, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_UPDATE_USER) + " VARCHAR(32) DEFAULT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ENABLED) + " BOOLEAN DEFAULT TRUE"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_LINK_INPUT =
-      "CREATE TABLE " + TABLE_SQ_LINK_INPUT + " ("
-          + COLUMN_SQ_LNKI_LINK + " BIGINT REFERENCES " + TABLE_SQ_LINK + "("  + COLUMN_SQ_LNK_ID + ")" + ", "
-          + COLUMN_SQ_LNKI_INPUT + " BIGINT REFERENCES " + TABLE_SQ_INPUT + "("  + COLUMN_SQI_ID + ")" + ", "
-          + COLUMN_SQ_LNKI_VALUE + " VARCHAR, "
-          + "PRIMARY KEY (" + COLUMN_SQ_LNKI_LINK + ", " + COLUMN_SQ_LNKI_INPUT + ")"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_INPUT_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_LINK) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_LINK_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNK_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_INPUT) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_VALUE) + " VARCHAR, "
+          + "PRIMARY KEY (" + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_LINK) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQ_LNKI_INPUT) + ")"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_JOB_INPUT =
-      "CREATE TABLE " + TABLE_SQ_JOB_INPUT + " ("
-          + COLUMN_SQBI_JOB + " BIGINT REFERENCES " + TABLE_SQ_JOB + "("  + COLUMN_SQB_ID + ")" + ", "
-          + COLUMN_SQBI_INPUT + " BIGINT REFERENCES " + TABLE_SQ_INPUT + "("  + COLUMN_SQI_ID + ")" + ", "
-          + COLUMN_SQBI_VALUE + " VARCHAR(1000), "
-          + "PRIMARY KEY (" + COLUMN_SQBI_JOB + ", " + COLUMN_SQBI_INPUT + ")"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_INPUT_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_JOB) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_INPUT) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_INPUT_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQI_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_VALUE) + " VARCHAR(1000), "
+          + "PRIMARY KEY (" + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_JOB) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQBI_INPUT) + ")"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_SUBMISSION =
-      "CREATE TABLE " + TABLE_SQ_SUBMISSION + " ("
-          + COLUMN_SQS_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQS_JOB + " BIGINT REFERENCES " + TABLE_SQ_JOB + "("  + COLUMN_SQB_ID + ") ON DELETE CASCADE, "
-          + COLUMN_SQS_STATUS + " VARCHAR(20), "
-          + COLUMN_SQS_CREATION_DATE + " TIMESTAMP, "
-          + COLUMN_SQS_CREATION_USER + " VARCHAR(32) DEFAULT NULL, "
-          + COLUMN_SQS_UPDATE_DATE + " TIMESTAMP, "
-          + COLUMN_SQS_UPDATE_USER + " VARCHAR(32) DEFAULT NULL, "
-          + COLUMN_SQS_EXTERNAL_ID + " VARCHAR(50), "
-          + COLUMN_SQS_EXTERNAL_LINK + " VARCHAR(150), "
-          + COLUMN_SQS_ERROR_SUMMARY + " VARCHAR(150), "
-          + COLUMN_SQS_ERROR_DETAILS + " VARCHAR(750)"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_JOB) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_JOB_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQB_ID) + ") ON DELETE CASCADE, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_STATUS) + " VARCHAR(20), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_CREATION_DATE) + " TIMESTAMP, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_CREATION_USER) + " VARCHAR(32) DEFAULT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_UPDATE_DATE) + " TIMESTAMP, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_UPDATE_USER) + " VARCHAR(32) DEFAULT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_EXTERNAL_ID) + " VARCHAR(50), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_EXTERNAL_LINK) + " VARCHAR(150), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ERROR_SUMMARY) + " VARCHAR(150), "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ERROR_DETAILS) + " VARCHAR(750)"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_COUNTER_GROUP =
-      "CREATE TABLE " + TABLE_SQ_COUNTER_GROUP + " ("
-          + COLUMN_SQG_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQG_NAME + " VARCHAR(75) UNIQUE"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_GROUP_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQG_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQG_NAME) + " VARCHAR(75) UNIQUE"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_COUNTER =
-      "CREATE TABLE " + TABLE_SQ_COUNTER + " ("
-          + COLUMN_SQR_ID + " BIGSERIAL PRIMARY KEY NOT NULL, "
-          + COLUMN_SQR_NAME + " VARCHAR(75) UNIQUE"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQR_ID) + " BIGSERIAL PRIMARY KEY NOT NULL, "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQR_NAME) + " VARCHAR(75) UNIQUE"
           + ")";
 
   public static final String QUERY_CREATE_TABLE_SQ_COUNTER_SUBMISSION =
-      "CREATE TABLE " + TABLE_SQ_COUNTER_SUBMISSION + " ("
-          + COLUMN_SQRS_GROUP + " BIGINT REFERENCES " + TABLE_SQ_COUNTER_GROUP + "("  + COLUMN_SQG_ID + ")" + ", "
-          + COLUMN_SQRS_COUNTER + " BIGINT REFERENCES " + TABLE_SQ_COUNTER + "("  + COLUMN_SQR_ID + ")" + ", "
-          + COLUMN_SQRS_SUBMISSION + " BIGINT REFERENCES " + TABLE_SQ_SUBMISSION + "("  + COLUMN_SQS_ID + ") ON DELETE CASCADE" + ", "
-          + COLUMN_SQRS_VALUE + " BIGINT, "
-          + "PRIMARY KEY (" + COLUMN_SQRS_GROUP + ", " + COLUMN_SQRS_COUNTER + ", " + COLUMN_SQRS_SUBMISSION + ")"
+      "CREATE TABLE " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_SUBMISSION_NAME) + " ("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_GROUP) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_GROUP_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQG_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_COUNTER) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_COUNTER_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQR_ID) + ")" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_SUBMISSION) + " BIGINT REFERENCES " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SUBMISSION_NAME) + "("  + CommonRepoUtils.escapeColumnName(COLUMN_SQS_ID) + ") ON DELETE CASCADE" + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_VALUE) + " BIGINT, "
+          + "PRIMARY KEY (" + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_GROUP) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_COUNTER) + ", " + CommonRepoUtils.escapeColumnName(COLUMN_SQRS_SUBMISSION) + ")"
           + ")";
 
   private PostgresqlSchemaCreateQuery() {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2b4db802/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaQuery.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaQuery.java b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaQuery.java
index a6319ac..3e83149 100644
--- a/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaQuery.java
+++ b/repository/repository-postgresql/src/main/java/org/apache/sqoop/repository/postgresql/PostgresqlSchemaQuery.java
@@ -17,6 +17,8 @@
  */
 package org.apache.sqoop.repository.postgresql;
 
+import org.apache.sqoop.repository.common.CommonRepoUtils;
+
 import static org.apache.sqoop.repository.postgresql.PostgresqlSchemaConstants.*;
 
 /**
@@ -26,23 +28,23 @@ public class PostgresqlSchemaQuery {
 
   public static final String STMT_SELECT_SYSTEM =
       "SELECT "
-          + COLUMN_SQM_VALUE
-          + " FROM " + TABLE_SQ_SYSTEM
-          + " WHERE " + COLUMN_SQM_KEY + " = ?";
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQM_VALUE)
+          + " FROM " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME)
+          + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + " = ?";
 
   public static final String STMT_DELETE_SYSTEM =
-      "DELETE FROM "  + TABLE_SQ_SYSTEM
-          + " WHERE " + COLUMN_SQM_KEY + " = ?";
+      "DELETE FROM "  + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME)
+          + " WHERE " + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + " = ?";
 
   public static final String STMT_INSERT_SYSTEM =
-      "INSERT INTO " + TABLE_SQ_SYSTEM + "("
-          + COLUMN_SQM_KEY + ", "
-          + COLUMN_SQM_VALUE + ") "
+      "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_SYSTEM_NAME) + "("
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQM_KEY) + ", "
+          + CommonRepoUtils.escapeColumnName(COLUMN_SQM_VALUE) + ") "
           + "VALUES(?, ?)";
 
   public static final String STMT_INSERT_DIRECTION =
-      "INSERT INTO " + TABLE_SQ_DIRECTION
-          + " (" + COLUMN_SQD_NAME+ ") VALUES (?)";
+      "INSERT INTO " + CommonRepoUtils.getTableName(SCHEMA_SQOOP, TABLE_SQ_DIRECTION_NAME)
+          + " (" + CommonRepoUtils.escapeColumnName(COLUMN_SQD_NAME)+ ") VALUES (?)";
 
   private PostgresqlSchemaQuery() {
     // Disable explicit object creation

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2b4db802/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestCase.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestCase.java b/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestCase.java
index ae546f3..98ba7a3 100644
--- a/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestCase.java
+++ b/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestCase.java
@@ -53,7 +53,7 @@ abstract public class PostgresqlTestCase {
 
   @AfterMethod(alwaysRun = true)
   public void tearDown() throws Exception {
-    provider.dropSchema("sqoop");
+    provider.dropSchema("SQOOP");
     provider.stop();
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2b4db802/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestUtils.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestUtils.java b/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestUtils.java
index f393521..19fd6e7 100644
--- a/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestUtils.java
+++ b/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/PostgresqlTestUtils.java
@@ -18,6 +18,7 @@
 package org.apache.sqoop.repository.postgresql;
 
 import org.apache.sqoop.common.test.db.DatabaseProvider;
+import org.apache.sqoop.repository.common.CommonRepoUtils;
 
 import java.sql.DatabaseMetaData;
 import java.sql.ResultSet;
@@ -62,8 +63,13 @@ public class PostgresqlTestUtils {
   }
 
   public void assertUniqueConstraints(String schema, String table, String... columns) throws Exception {
-    Set<String> columnSet = new TreeSet<String>(Arrays.asList(columns));
+    Set<String> columnSet = new TreeSet<String>();
     Map<String, Set<String>> indexColumnMap = new HashMap<String, Set<String>>();
+
+    for (String column : columns) {
+      columnSet.add(CommonRepoUtils.escapeColumnName(column));
+    }
+
     DatabaseMetaData md = provider.getConnection().getMetaData();
     ResultSet rs = md.getIndexInfo(null, schema, table, true, false);
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2b4db802/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/TestStructure.java
----------------------------------------------------------------------
diff --git a/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/TestStructure.java b/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/TestStructure.java
index 6075de4..941bb69 100644
--- a/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/TestStructure.java
+++ b/repository/repository-postgresql/src/test/java/org/apache/sqoop/repository/postgresql/TestStructure.java
@@ -26,52 +26,52 @@ public class TestStructure extends PostgresqlTestCase {
 
   @Test
   public void testTables() throws Exception {
-    utils.assertTableExists("sqoop", "sq_system");
-    utils.assertTableExists("sqoop", "sq_direction");
-    utils.assertTableExists("sqoop", "sq_configurable");
-    utils.assertTableExists("sqoop", "sq_connector_directions");
-    utils.assertTableExists("sqoop", "sq_config");
-    utils.assertTableExists("sqoop", "sq_connector_directions");
-    utils.assertTableExists("sqoop", "sq_input");
-    utils.assertTableExists("sqoop", "sq_link");
-    utils.assertTableExists("sqoop", "sq_job");
-    utils.assertTableExists("sqoop", "sq_link_input");
-    utils.assertTableExists("sqoop", "sq_job_input");
-    utils.assertTableExists("sqoop", "sq_submission");
-    utils.assertTableExists("sqoop", "sq_counter_group");
-    utils.assertTableExists("sqoop", "sq_counter");
-    utils.assertTableExists("sqoop", "sq_counter_submission");
+    utils.assertTableExists("SQOOP", "SQ_SYSTEM");
+    utils.assertTableExists("SQOOP", "SQ_DIRECTION");
+    utils.assertTableExists("SQOOP", "SQ_CONFIGURABLE");
+    utils.assertTableExists("SQOOP", "SQ_CONNECTOR_DIRECTIONS");
+    utils.assertTableExists("SQOOP", "SQ_CONFIG");
+    utils.assertTableExists("SQOOP", "SQ_CONNECTOR_DIRECTIONS");
+    utils.assertTableExists("SQOOP", "SQ_INPUT");
+    utils.assertTableExists("SQOOP", "SQ_LINK");
+    utils.assertTableExists("SQOOP", "SQ_JOB");
+    utils.assertTableExists("SQOOP", "SQ_LINK_INPUT");
+    utils.assertTableExists("SQOOP", "SQ_JOB_INPUT");
+    utils.assertTableExists("SQOOP", "SQ_SUBMISSION");
+    utils.assertTableExists("SQOOP", "SQ_COUNTER_GROUP");
+    utils.assertTableExists("SQOOP", "SQ_COUNTER");
+    utils.assertTableExists("SQOOP", "SQ_COUNTER_SUBMISSION");
   }
 
   @Test
   public void testForeignKeys() throws Exception {
-    utils.assertForeignKey("sqoop", "sq_configurable", "sqc_id", "sq_connector_directions", "sqcd_connector");
-    utils.assertForeignKey("sqoop", "sq_direction", "sqd_id", "sq_connector_directions", "sqcd_direction");
-    utils.assertForeignKey("sqoop", "sq_configurable", "sqc_id", "sq_config", "sq_cfg_configurable");
-    utils.assertForeignKey("sqoop", "sq_config", "sq_cfg_id", "sq_config_directions", "sq_cfg_dir_config");
-    utils.assertForeignKey("sqoop", "sq_direction", "sqd_id", "sq_config_directions", "sq_cfg_dir_direction");
-    utils.assertForeignKey("sqoop", "sq_config", "sq_cfg_id", "sq_input", "sqi_config");
-    utils.assertForeignKey("sqoop", "sq_configurable", "sqc_id", "sq_link", "sq_lnk_configurable");
-    utils.assertForeignKey("sqoop", "sq_link", "sq_lnk_id", "sq_job", "sqb_from_link");
-    utils.assertForeignKey("sqoop", "sq_link", "sq_lnk_id", "sq_job", "sqb_to_link");
-    utils.assertForeignKey("sqoop", "sq_link", "sq_lnk_id", "sq_link_input", "sq_lnki_link");
-    utils.assertForeignKey("sqoop", "sq_input", "sqi_id", "sq_link_input", "sq_lnki_input");
-    utils.assertForeignKey("sqoop", "sq_job", "sqb_id", "sq_job_input", "sqbi_job");
-    utils.assertForeignKey("sqoop", "sq_input", "sqi_id", "sq_job_input", "sqbi_input");
-    utils.assertForeignKey("sqoop", "sq_job", "sqb_id", "sq_submission", "sqs_job");
-    utils.assertForeignKey("sqoop", "sq_counter", "sqr_id", "sq_counter_submission", "sqrs_counter");
-    utils.assertForeignKey("sqoop", "sq_counter_group", "sqg_id", "sq_counter_submission", "sqrs_group");
-    utils.assertForeignKey("sqoop", "sq_submission", "sqs_id", "sq_counter_submission", "sqrs_submission");
+    utils.assertForeignKey("SQOOP", "SQ_CONFIGURABLE", "SQC_ID", "SQ_CONNECTOR_DIRECTIONS", "SQCD_CONNECTOR");
+    utils.assertForeignKey("SQOOP", "SQ_DIRECTION", "SQD_ID", "SQ_CONNECTOR_DIRECTIONS", "SQCD_DIRECTION");
+    utils.assertForeignKey("SQOOP", "SQ_CONFIGURABLE", "SQC_ID", "SQ_CONFIG", "SQ_CFG_CONFIGURABLE");
+    utils.assertForeignKey("SQOOP", "SQ_CONFIG", "SQ_CFG_ID", "SQ_CONFIG_DIRECTIONS", "SQ_CFG_DIR_CONFIG");
+    utils.assertForeignKey("SQOOP", "SQ_DIRECTION", "SQD_ID", "SQ_CONFIG_DIRECTIONS", "SQ_CFG_DIR_DIRECTION");
+    utils.assertForeignKey("SQOOP", "SQ_CONFIG", "SQ_CFG_ID", "SQ_INPUT", "SQI_CONFIG");
+    utils.assertForeignKey("SQOOP", "SQ_CONFIGURABLE", "SQC_ID", "SQ_LINK", "SQ_LNK_CONFIGURABLE");
+    utils.assertForeignKey("SQOOP", "SQ_LINK", "SQ_LNK_ID", "SQ_JOB", "SQB_FROM_LINK");
+    utils.assertForeignKey("SQOOP", "SQ_LINK", "SQ_LNK_ID", "SQ_JOB", "SQB_TO_LINK");
+    utils.assertForeignKey("SQOOP", "SQ_LINK", "SQ_LNK_ID", "SQ_LINK_INPUT", "SQ_LNKI_LINK");
+    utils.assertForeignKey("SQOOP", "SQ_INPUT", "SQI_ID", "SQ_LINK_INPUT", "SQ_LNKI_INPUT");
+    utils.assertForeignKey("SQOOP", "SQ_JOB", "SQB_ID", "SQ_JOB_INPUT", "SQBI_JOB");
+    utils.assertForeignKey("SQOOP", "SQ_INPUT", "SQI_ID", "SQ_JOB_INPUT", "SQBI_INPUT");
+    utils.assertForeignKey("SQOOP", "SQ_JOB", "SQB_ID", "SQ_SUBMISSION", "SQS_JOB");
+    utils.assertForeignKey("SQOOP", "SQ_COUNTER", "SQR_ID", "SQ_COUNTER_SUBMISSION", "SQRS_COUNTER");
+    utils.assertForeignKey("SQOOP", "SQ_COUNTER_GROUP", "SQG_ID", "SQ_COUNTER_SUBMISSION", "SQRS_GROUP");
+    utils.assertForeignKey("SQOOP", "SQ_SUBMISSION", "SQS_ID", "SQ_COUNTER_SUBMISSION", "SQRS_SUBMISSION");
   }
 
   @Test
   public void testUniqueConstraints() throws Exception {
-    utils.assertUniqueConstraints("sqoop", "sq_configurable", "sqc_name");
-    utils.assertUniqueConstraints("sqoop", "sq_link", "sq_lnk_name");
-    utils.assertUniqueConstraints("sqoop", "sq_job", "sqb_name");
-    utils.assertUniqueConstraints("sqoop", "sq_config", "sq_cfg_name", "sq_cfg_configurable", "sq_cfg_type");
-    utils.assertUniqueConstraints("sqoop", "sq_input", "sqi_name", "sqi_type", "sqi_config");
-    utils.assertUniqueConstraints("sqoop", "sq_counter", "sqr_name");
-    utils.assertUniqueConstraints("sqoop", "sq_counter_group", "sqg_name");
+    utils.assertUniqueConstraints("SQOOP", "SQ_CONFIGURABLE", "SQC_NAME");
+    utils.assertUniqueConstraints("SQOOP", "SQ_LINK", "SQ_LNK_NAME");
+    utils.assertUniqueConstraints("SQOOP", "SQ_JOB", "SQB_NAME");
+    utils.assertUniqueConstraints("SQOOP", "SQ_CONFIG", "SQ_CFG_NAME", "SQ_CFG_CONFIGURABLE", "SQ_CFG_TYPE");
+    utils.assertUniqueConstraints("SQOOP", "SQ_INPUT", "SQI_NAME", "SQI_TYPE", "SQI_CONFIG");
+    utils.assertUniqueConstraints("SQOOP", "SQ_COUNTER", "SQR_NAME");
+    utils.assertUniqueConstraints("SQOOP", "SQ_COUNTER_GROUP", "SQG_NAME");
   }
 }


Mime
View raw message