Commits

tbrugz  committed b077b27

processor: SQLQueries: logging changes

  • Participants
  • Parent commits a491aca

Comments (0)

Files changed (1)

File src/tbrugz/sqldump/datadump/SQLQueries.java

 			try {
 				stmt = conn.prepareStatement(sql);
 			} catch (SQLException e) {
-				log.warn("error creating prepared statement [id="+qid+";sql="+sql+"]");
+				String message = "error creating prepared statement [id="+qid+";sql="+sql+"]: "+e.getMessage();
+				log.warn(message);
+				if(failonerror) {
+					throw new ProcessingException(message, e);
+				}
 				//continue; //?
 			}
 			
 				queriesGrabbed += addQueryToModelInternal(qid, queryName, defaultSchemaName, stmt, sql, keyCols, params, remarks, rsDecoratorFactory, rsFactoryArgs, rsArgPrepend);
 			}
 			
-			if(runQueries) {
+			if(runQueries && stmt!=null) {
 				try {
 					log.debug("running query [id="+qid+"; name="+queryName+"]: "+sql);
 					DataDump dd = new DataDump();