You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by al...@apache.org on 2017/12/05 23:10:03 UTC

svn commit: r1817249 - /ctakes/trunk/ctakes-ytex/src/main/java/org/apache/ctakes/util/JdbcOperationsHelper.java

Author: alexz
Date: Tue Dec  5 23:10:03 2017
New Revision: 1817249

URL: http://svn.apache.org/viewvc?rev=1817249&view=rev
Log:
CTAKES-488: fix WARN message for JdbcOperationsHelper

Modified:
    ctakes/trunk/ctakes-ytex/src/main/java/org/apache/ctakes/util/JdbcOperationsHelper.java

Modified: ctakes/trunk/ctakes-ytex/src/main/java/org/apache/ctakes/util/JdbcOperationsHelper.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-ytex/src/main/java/org/apache/ctakes/util/JdbcOperationsHelper.java?rev=1817249&r1=1817248&r2=1817249&view=diff
==============================================================================
--- ctakes/trunk/ctakes-ytex/src/main/java/org/apache/ctakes/util/JdbcOperationsHelper.java (original)
+++ ctakes/trunk/ctakes-ytex/src/main/java/org/apache/ctakes/util/JdbcOperationsHelper.java Tue Dec  5 23:10:03 2017
@@ -18,21 +18,21 @@ public abstract class JdbcOperationsHelp
 	 *
 	 * @param jdbc
 	 * @param dbEngineType
-	 * @param sqlTableName
+	 * @param tableName
 	 */
-	protected final void dropTableIfExist(JdbcOperations jdbc, final String dbEngineType, final String sqlTableName) {
+	protected final void dropTableIfExist(JdbcOperations jdbc, final String dbEngineType, final String tableName) {
 		// TODO: consider refactor using JOOQ
 		String sqlStatement = "";
 		switch (dbEngineType.toLowerCase()) {
 			case "hsql":
 			case "mysql":
-				sqlStatement = String.format("DROP TABLE IF EXISTS %s", sqlTableName);
+				sqlStatement = String.format("DROP TABLE IF EXISTS %s", tableName);
 				break;
 			case "mssql":
-				sqlStatement = String.format("IF EXISTS(SELECT * FROM sys.objects WHERE object_id = object_id('%s')) DROP TABLE %s", sqlTableName);
+				sqlStatement = String.format("IF EXISTS(SELECT * FROM sys.objects WHERE object_id = object_id('%s')) DROP TABLE %s", tableName);
 				break;
 			case "orcl":
-				sqlStatement = String.format("DROP TABLE %s", sqlTableName);
+				sqlStatement = String.format("DROP TABLE %s", tableName);
 				break;
 			default:
 				LOGGER.warn(String.format("unsupported DB engine type: %s", dbEngineType));
@@ -42,7 +42,7 @@ public abstract class JdbcOperationsHelp
 			try {
 				jdbc.execute(sqlStatement);
 			} catch (DataAccessException e) {
-				LOGGER.warn("couldn't drop table test_concepts. Maybe it doesn't even exists", e);
+				LOGGER.warn(String.format("couldn't drop table %s. Maybe it doesn't even exists", tableName), e);
 			}
 		}
 	}