/** * Method that selects and specific <tt>field</tt> on a <tt>table</tt> according to if present a * <tt>whereClause</tt>. * * @param field The field to be selected. * @param table The table to be selected. * @param whereClause Should the SELECT use a where clause, it should be in the format <b>ID = 1 * AND SecondID = 2</b> and so on, regular SQL operations apply. * @return A <tt>ResultSet</tt> containing the result of the SELECT * @throws SQLException */ public static ResultSet select(String field, String table, String whereClause) throws SQLException { String[] fields = {field}; return ConnectionManager.select(fields, table, whereClause); }
/** * Method that selects all <tt>Rows</tt> in a specific table. Its equivalent to "<b>SELECT * FROM * <tt>table</tt></b>". * * @param table The table to be updated. * @return A <tt>ResultSet</tt> containing the result of the SELECT * @throws SQLException */ public static ResultSet selectAllRows(String table) throws SQLException { String[] fields = {"*"}; return ConnectionManager.select(fields, table, ""); }