Here you can find the source of queryReturnRS(String sql)
public static ResultSet queryReturnRS(String sql)
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { private static Connection conn = null; private static PreparedStatement preStatement = null; private static ResultSet rs = null; public static ResultSet queryReturnRS(String sql) { if (null == conn) { return null; }//w w w . ja v a 2 s . c o m try { preStatement = conn.prepareStatement(sql); rs = preStatement.executeQuery(); } catch (SQLException e) { e.printStackTrace(); } return rs; } }