aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/juick/server')
-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 479fd1cc8..28ccdb8ca 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;