From: Hendrik <nh...@us...> - 2009-07-11 14:48:26
|
Update of /cvsroot/arianne/marauroa/src/marauroa/server/db/adapter In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20370/src/marauroa/server/db/adapter Modified Files: DatabaseAdapter.java Log Message: added javadoc to all methods Index: DatabaseAdapter.java =================================================================== RCS file: /cvsroot/arianne/marauroa/src/marauroa/server/db/adapter/DatabaseAdapter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DatabaseAdapter.java 10 Jul 2009 23:03:59 -0000 1.5 --- DatabaseAdapter.java 11 Jul 2009 14:48:19 -0000 1.6 *************** *** 13,28 **** public interface DatabaseAdapter { ! void commit() throws SQLException; ! void rollback() throws SQLException; public int execute(String sql) throws SQLException; public void execute(String sql, InputStream... inputStreams) throws SQLException, IOException; public void executeBatch(String sql, InputStream... inputStreams) throws SQLException, IOException; public ResultSet query(String sql) throws SQLException; public int querySingleCellInt(String sql) throws SQLException; --- 13,75 ---- public interface DatabaseAdapter { ! /** ! * commits the current transaction ! * ! * @throws SQLException in case of an database error ! */ ! public void commit() throws SQLException; ! /** ! * rolls the current transaction back, undoing all the changes. ! * ! * @throws SQLException in case of an database error ! */ ! public void rollback() throws SQLException; + /** + * executes an SQL statement + * + * @param sql sql-statement to execute + * @return number of affected rows + * @throws SQLException in case of an database error + */ public int execute(String sql) throws SQLException; + /** + * executes an SQL statement with streamed parameters + * + * @param sql sql-statement to execute + * @param inputStreams parameters + * @throws SQLException in case of an database error + * @throws IOException in case the stream cannot be read to the end + */ public void execute(String sql, InputStream... inputStreams) throws SQLException, IOException; + /** + * executes a batch of sql-statements + * + * @param sql sql-statement to execute + * @param inputStreams a list of inpurt stream. For each of them the statement is executed + * @throws SQLException in case of an database error + * @throws IOException in case one of the streams cannot be read to the end + */ public void executeBatch(String sql, InputStream... inputStreams) throws SQLException, IOException; + /** + * queries the database for information + * + * @param sql sql-statement to execute + * @return ResultSet + * @throws SQLException in case of an database error + */ public ResultSet query(String sql) throws SQLException; + /** + * queries for a single row, single column integer response like a count-select + * + * @param sql sql-statement to execute + * @return integer of the first column in the first row + * @throws SQLException in case of an database error + */ public int querySingleCellInt(String sql) throws SQLException; |