Here you can find the source of executeUpdate(final Connection conn, final String query)
Parameter | Description |
---|---|
connection | a parameter |
query | a parameter |
public static void executeUpdate(final Connection conn, final String query) throws SQLException
//package com.java2s; /*//from w ww. j a va 2s . c om * Copyright (C) 2012 Openismus GmbH * Copyright (C) 2015 Murray Cumming * * This file is part of swing-glom * * swing-glom is free software: you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * swing-glom is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with swing-glom. If not, see <http://www.gnu.org/licenses/>. */ import java.sql.*; public class Main { /** * @param connection * @param query */ public static void executeUpdate(final Connection conn, final String query) throws SQLException { conn.setAutoCommit(false); final Statement st = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); st.executeUpdate(query); } }