Java SQL Execute execute(Connection conn, String string)

Here you can find the source of execute(Connection conn, String string)

Description

execute

License

Apache License

Declaration

public static int execute(Connection conn, String string) throws SQLException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.SQLException;

public class Main {
    public static int execute(Connection conn, String string) throws SQLException {
        PreparedStatement st = conn.prepareStatement(string);
        try {//from   ww w. j  a  v  a 2s.c o m
            return st.executeUpdate();
        } finally {
            st.close();
        }
    }
}

Related

  1. execStatement(Connection con, String strStatement)
  2. execte(Connection conn, String sql)
  3. execute(Connection conn, String SQL)
  4. execute(Connection conn, String sql, Object[] args)
  5. execute(Connection conn, String sql, Object[] params)
  6. execute(Connection connection, String sql)
  7. execute(Connection connection, String sql, boolean closeConn)
  8. execute(final String url, final String username, final String password, final String sql, final Consumer consumer)
  9. execute(List sql)