From e286dc7e1d2ba75778220a3621343c334b4cc3da Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Sat, 12 Apr 2014 16:39:30 +0700 Subject: SQLHelpers.execute --- src/com/juick/server/SQLHelpers.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/com/juick') 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; -- cgit v1.2.3