mcconnell 2003/02/04 22:15:56 Modified: src/java/org/apache/log/output/db DefaultJDBCTarget.java ColumnInfo.java Log: Checkstyle corrections and javadoc additions. Revision Changes Path 1.7 +26 -0 jakarta-avalon-logkit/src/java/org/apache/log/output/db/DefaultJDBCTarget.java Index: DefaultJDBCTarget.java =================================================================== RCS file: /home/cvs/jakarta-avalon-logkit/src/java/org/apache/log/output/db/DefaultJDBCTarget.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DefaultJDBCTarget.java 3 Feb 2003 17:40:13 -0000 1.6 +++ DefaultJDBCTarget.java 5 Feb 2003 06:15:56 -0000 1.7 @@ -76,6 +76,12 @@ private PreparedStatement m_statement; + /** + * Creation of a new JDBC logging target. + * @param dataSource the JDBC datasource + * @param table the table + * @param columns a ColumnInfo array + */ public DefaultJDBCTarget( final DataSource dataSource, final String table, final ColumnInfo[] columns ) @@ -151,6 +157,10 @@ } } + /** + * Return the SQL insert statement. + * @return the statement + */ protected String getStatementSQL() { final StringBuffer sb = new StringBuffer( "INSERT INTO " ); @@ -176,6 +186,10 @@ return sb.toString(); } + /** + * Test if the target is stale. + * @return TRUE if the target is stale else FALSE + */ protected boolean isStale() { return super.isStale(); @@ -208,6 +222,9 @@ /** * Adds a single object into statement. + * @param statement the prepard statement + * @param index the index + * @param event the log event */ protected void specifyColumn( final PreparedStatement statement, final int index, @@ -256,11 +273,20 @@ } } + /** + * Return the underlying table + * @return the table name + */ protected final String getTable() { return m_table; } + /** + * Return the column info for an supplied index. + * @param index the index + * @return the column info + */ protected final ColumnInfo getColumn( final int index ) { return m_columns[ index ]; 1.5 +19 -0 jakarta-avalon-logkit/src/java/org/apache/log/output/db/ColumnInfo.java Index: ColumnInfo.java =================================================================== RCS file: /home/cvs/jakarta-avalon-logkit/src/java/org/apache/log/output/db/ColumnInfo.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ColumnInfo.java 3 Feb 2003 17:40:13 -0000 1.4 +++ ColumnInfo.java 5 Feb 2003 06:15:56 -0000 1.5 @@ -57,6 +57,7 @@ /** * A descriptor for each column stored in table. * + * @author <a href="mailto:avalon-dev@jakarta.apache.org">Avalon Development Team</a> * @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a> */ public class ColumnInfo @@ -70,6 +71,12 @@ ///Auxilliary parameters (ie constant or sub-format) private final String m_aux; //may be null + /** + * Creation of a new column info instance. + * @param name the column name + * @param type the column type + * @param aux the auxillary value + */ public ColumnInfo( final String name, final int type, final String aux ) { m_name = name; @@ -77,16 +84,28 @@ m_aux = aux; } + /** + * Return the column name + * @param the name of the column + */ public String getName() { return m_name; } + /** + * Return the column type as an integer + * @return the type + */ public int getType() { return m_type; } + /** + * Return the auxillary column information. + * @return the information + */ public String getAux() { return m_aux;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]