Java SQL Update execUpdateQuery(Connection C, String query)

Here you can find the source of execUpdateQuery(Connection C, String query)

Description

exec Update Query

License

Open Source License

Declaration

public static void execUpdateQuery(Connection C, String query) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.*;

public class Main {
    public static void execUpdateQuery(Connection C, String query) {

        Statement S;//  w  w w .j  av a  2 s  .co m

        try {
            S = C.createStatement();
            S.executeUpdate(query);
            S.close();
        } // end try
        catch (SQLException E) {
            System.out.println("SQLException: " + E.getMessage());
            System.out.println("SQLState:     " + E.getSQLState());
            System.out.println("VendorError:  " + E.getErrorCode());
        } // end catch

    }
}

Related

  1. ExecUpdateSql(Connection conn, String strSql)
  2. executeUpdate(Connection conn, String sql)
  3. executeUpdate(Connection conn, String sql)
  4. executeUpdate(Connection conn, String sql)