Here you can find the source of executeSql(Connection conn, String sql)
public static ResultSet executeSql(Connection conn, String sql) throws SQLException
//package com.java2s; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { public static ResultSet executeSql(Connection conn, String sql) throws SQLException { Statement stmt = conn.createStatement(); stmt.setQueryTimeout(20);//from w w w . ja va 2 s. c o m ResultSet rs = stmt.executeQuery(sql); return rs; } }