Java SQL Execute executeSQLCommandWithResult(Connection conn, String sql)

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

Description

execute SQL Command With Result

License

LGPL

Declaration

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

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.sql.*;

public class Main {
    public static ResultSet executeSQLCommandWithResult(Connection conn, String sql) throws SQLException {
        conn.setAutoCommit(true);/*from  ww  w  . ja v  a 2s  .c o m*/
        Statement st = conn.createStatement();
        return st.executeQuery(sql);
    }
}

Related

  1. executeSql(Connection conn, String sql)
  2. executeSQL(Connection connection, String file)
  3. executeSQL(Connection session, String sql, Object... params)
  4. executeSqlAutoCommit(Connection connection, String sql)
  5. executeSQLCommand(Connection conn, String sql, byte[] blob)
  6. executeSqlFile(Connection connection, String sqlPath)
  7. executeSqlFile(String filename, Connection connection)
  8. executeSqlFromSql(Connection connection, String sql, String name)
  9. executeStatement(Connection con, String sql)