Java SQL Query executeQuery(Statement state, String sql)

Here you can find the source of executeQuery(Statement state, String sql)

Description

execute Query

License

Open Source License

Parameter

Parameter Description
state a parameter
sql a parameter

Exception

Parameter Description
SQLException an exception

Declaration

public static ResultSet executeQuery(Statement state, String sql) throws SQLException 

Method Source Code


//package com.java2s;
import java.sql.*;

public class Main {
    /**/*from www. j a v a  2 s .c  o m*/
     * 
     * @param state
     * @param sql
     * @return
     * @throws SQLException
     */
    public static ResultSet executeQuery(Statement state, String sql) throws SQLException {
        try {
            ResultSet rs = state.executeQuery(sql);
            return rs;
        } catch (SQLException ex) {
            throw ex;
        }
    }
}

Related

  1. ExecuteQuery(Connection conn, PreparedStatement preparedStatement, PreparedStatement lockStatement, String tablename)
  2. executeQuery(Connection connection)
  3. executeQuery(Connection connection, String query)
  4. executeQuery(Connection dbConnection, String selectString)
  5. executeQuery(java.sql.Connection con, String select, Object pk)
  6. ExecuteQuery(String command)
  7. executeQuery(String query)
  8. executeQuery(String sql, Connection conn, List param)
  9. executeQuery(String sql, String[] parameters)

  10. HOME | Copyright © www.java2s.com 2016