aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/juick/server/SQLHelpers.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/juick/server/SQLHelpers.java b/src/com/juick/server/SQLHelpers.java
index 479fd1cc..28ccdb8c 100644
--- a/src/com/juick/server/SQLHelpers.java
+++ b/src/com/juick/server/SQLHelpers.java
@@ -16,6 +16,20 @@ import java.util.ArrayList;
*/
public class SQLHelpers {
+ public static int execute(Connection sql, String query) {
+ int ret = -1;
+ PreparedStatement stmt = null;
+ try {
+ stmt = sql.prepareStatement(query);
+ ret = stmt.executeUpdate();
+ } catch (SQLException e) {
+ System.err.println(e);
+ } finally {
+ Utils.finishSQL(null, stmt);
+ }
+ return ret;
+ }
+
public static int executeInt(Connection sql, String query, int param) {
int ret = -1;
PreparedStatement stmt = null;