ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From al...@apache.org
Subject svn commit: r1817249 - /ctakes/trunk/ctakes-ytex/src/main/java/org/apache/ctakes/util/JdbcOperationsHelper.java
Date Tue, 05 Dec 2017 23:10:03 GMT
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);
 			}
 		}
 	}



Mime
View raw message