Java SQL Execute execSql(String sql, Connection conn)

Here you can find the source of execSql(String sql, Connection conn)

Description

exec Sql

Declaration

public static boolean execSql(String sql, Connection conn) throws Exception 

Method Source Code


//package com.java2s;
import java.sql.Connection;

import java.sql.PreparedStatement;

public class Main {

    public static boolean execSql(String sql, Connection conn) throws Exception {
        PreparedStatement ps = conn.prepareStatement(sql);
        boolean result = false;
        try {/* w w  w . j av  a2s.c o  m*/
            ps.execute();

        } finally {
            ps.close();
        }
        return result;
    }
}

Related

  1. exec(Connection conn, String sql)
  2. exec(Connection psql, String sql)
  3. execStatement(Connection con, String strStatement)
  4. execte(Connection conn, String sql)
  5. execute(Connection conn, String SQL)
  6. execute(Connection conn, String sql, Object[] args)