--- a/java/sql-dk/src/info/globalcode/sql/dk/DatabaseConnection.java Sun Dec 22 23:31:55 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/DatabaseConnection.java Sun Dec 22 23:55:07 2013 +0100
@@ -76,8 +76,22 @@
formatter.writeParameters(sqlCommand.getParameters());
try (PreparedStatement ps = sqlCommand.prepareStatement(connection)) {
sqlCommand.parametrize(ps);
- try (ResultSet rs = ps.executeQuery()) {
- processResultSet(rs, formatter);
+
+ boolean isRS = ps.execute();
+ if (isRS) {
+ try (ResultSet rs = ps.getResultSet()) {
+ processResultSet(rs, formatter);
+ }
+ } else {
+ /**
+ * TODO: process UPDATE command
+ */
+ }
+
+ while (ps.getMoreResults() || ps.getUpdateCount() > -1) {
+ /**
+ * TODO: process more RS or UPDATEs
+ */
}
}