/** * The Logger class is a simple log handler for databases. * * @author René Jahn */ public class Logger { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class members //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** the log statement. */ private PreparedStatement psLog; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Initialization //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Creates a new instance of Logger for a specific database. * * @param pAccess the database access * @throws SQLException if the log statement could not be initialized */ public Logger(DBAccess pAccess) throws SQLException { psLog = pAccess.getConnection().prepareStatement(""); } /** * Logs an error message to the database. * * @param pMessage the error message * @throws SQLException if it's not possible to log an error message */ public void error(String pMessage) throws SQLException { psLog.setString(1, pMessage); } } // Logger