get Result Set - Java java.sql

Java examples for java.sql:ResultSet

Description

get Result Set

Demo Code


//package com.java2s;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Main {

    public static ResultSet getResultSet(Statement stmt, String sql) {
        ResultSet rs = null;// ww  w. ja v  a  2  s  . c  o m
        try {
            rs = stmt.executeQuery(sql);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return rs;
    }
}

Related Tutorials