Here you can find the source of execute(Statement statement, String sql)
public static ResultSet execute(Statement statement, String sql) throws ClassNotFoundException, SQLException, Exception
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { public static ResultSet execute(Statement statement, String sql) throws ClassNotFoundException, SQLException, Exception { if (statement == null) { throw new Exception(); }//from www . j a v a 2 s .c o m ResultSet resultSet = null; try { resultSet = statement.executeQuery(sql); } catch (SQLException e) { throw e; } return (resultSet); } }