aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/server/SQLHelpers.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-04-12 16:39:30 +0700
committerGravatar Ugnich Anton2014-04-12 16:39:30 +0700
commite286dc7e1d2ba75778220a3621343c334b4cc3da (patch)
treefecf511130a2a8d35a8fdc9fdad4bd25efa76ebb /src/com/juick/server/SQLHelpers.java
parent2ccd7c92282e4db091c953680b099111634ed09c (diff)
SQLHelpers.execute
Diffstat (limited to 'src/com/juick/server/SQLHelpers.java')
-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;