Java SQL Execute executeSql(Connection conn, String sql)

Here you can find the source of executeSql(Connection conn, String sql)

Description

execute Sql

License

Open Source License

Declaration

public static ResultSet executeSql(Connection conn, String sql) throws SQLException 

Method Source Code


//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;
    }
}

Related

  1. executeSetArgs(PreparedStatement stmt, Object... args)
  2. executeShutDownForHSQL(java.sql.Connection connection)
  3. executeSP(Connection conn, String spName, Object... parameters)
  4. executeSql(Connection conn, String sql)
  5. executeSQL(Connection conn, String sql)
  6. executeSQL(Connection connection, String file)
  7. executeSQL(Connection session, String sql, Object... params)
  8. executeSqlAutoCommit(Connection connection, String sql)
  9. executeSQLCommand(Connection conn, String sql, byte[] blob)