Here you can find the source of exec(Connection psql, String sql)
public static void exec(Connection psql, String sql) throws SQLException
//package com.java2s; import java.sql.*; public class Main { public static void exec(Connection psql, String sql) throws SQLException { Statement statement = psql.createStatement(); statement.execute(sql);/*ww w .j a va2 s. c o m*/ statement.close(); } }