master
Zoran Zaric 7 years ago
parent a08c71926f
commit 20d6827d0a

@ -57,8 +57,7 @@ public class SqlExecutor {
return resultBuilder.build(); return resultBuilder.build();
} }
public static QueryResult executeJsonQuery(Connection conn, String json) public static QueryResult executeJsonQuery(Connection conn, String json) throws SQLException, JsonParseException, JsonMappingException, IOException {
throws SQLException, JsonParseException, JsonMappingException, IOException {
log.debug("Parsing JSON: " + json); log.debug("Parsing JSON: " + json);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
@ -94,8 +93,7 @@ public class SqlExecutor {
stmt.setLong(parameterIndex, (Long) object); stmt.setLong(parameterIndex, (Long) object);
} else { } else {
stmt.setString(parameterIndex, (String) object); stmt.setString(parameterIndex, (String) object);
String message = String.format("Unhandled paramter type <%s>. Defaulting to String", String message = String.format("Unhandled paramter type <%s>. Defaulting to String", object.getClass().getName());
object.getClass().getName());
log.warn(message); log.warn(message);
} }
} else { } else {
@ -175,8 +173,7 @@ public class SqlExecutor {
return columnDefinitions; return columnDefinitions;
} }
private static void handleUserErrors(Connection conn, String sql, Statement stmt) private static void handleUserErrors(Connection conn, String sql, Statement stmt) throws SQLException, SqlExecutionException {
throws SQLException, SqlExecutionException {
SQLWarning warnings = stmt.getWarnings(); SQLWarning warnings = stmt.getWarnings();
List<UserError> userErrors = new Vector<UserError>(); List<UserError> userErrors = new Vector<UserError>();
if (warnings != null) { if (warnings != null) {

Loading…
Cancel
Save