Here you can find the source of executeQuery(Connection c, String query)
Parameter | Description |
---|---|
c | c |
query | query |
Parameter | Description |
---|---|
SQLException | SQLException |
public static ResultSet executeQuery(Connection c, String query) throws SQLException
//package com.java2s; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { /**//from w ww.ja va2 s .c o m * executeQuery * * @param c * c * @param query * query * * @return DOCUMENT ME! * * @throws SQLException * SQLException */ public static ResultSet executeQuery(Connection c, String query) throws SQLException { ResultSet rs = null; Statement st = null; try { st = c.createStatement(); rs = st.executeQuery(query); } catch (SQLException ee) { if (st != null) { st.close(); } if (rs != null) { try { rs.close(); } catch (Exception eee) { } } throw ee; } return rs; } }