Se elimino el sistema de logging de java

Planeo hacerlo nuevamente con una libreria
This commit is contained in:
Daniel Cortes
2019-03-07 21:38:57 -03:00
parent 2dbf62f9b9
commit eeea52b525
15 changed files with 0 additions and 186 deletions

BIN
dist/Programa Caja.jar vendored

Binary file not shown.

View File

@@ -1,10 +0,0 @@
#handlers= java.util.logging.ConsoleHandler
handlers= java.util.logging.FileHandler
java.util.logging.FileHandler.level=SEVERE
java.util.logging.FileHandler.pattern=logs/logs-%u-%g.log
java.util.logging.FileHandler.formatter=java.util.logging.XMLFormatter
java.util.logging.FileHandler.append=true
#java.util.logging.ConsoleHandler.level = ALL
#java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
danielcortes.level=FINER

View File

@@ -28,10 +28,7 @@ import danielcortes.xyz.controllers.BaseLayoutController;
import danielcortes.xyz.data.Configuration; import danielcortes.xyz.data.Configuration;
import danielcortes.xyz.data.DAOManager; import danielcortes.xyz.data.DAOManager;
import danielcortes.xyz.views.BaseLayout; import danielcortes.xyz.views.BaseLayout;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Locale; import java.util.Locale;
import java.util.logging.LogManager;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.UIManager; import javax.swing.UIManager;
@@ -42,7 +39,6 @@ public class Main {
private static final int DATABASE_VERSION = 2; private static final int DATABASE_VERSION = 2;
static { static {
setUpLogger();
setUpSystemProperties(); setUpSystemProperties();
updateDatabase(); updateDatabase();
} }
@@ -83,17 +79,4 @@ public class Main {
Locale.setDefault(new Locale("es")); Locale.setDefault(new Locale("es"));
} }
private static void setUpLogger() {
LogManager manager = LogManager.getLogManager();
try {
FileInputStream in = new FileInputStream("config/logging.properties");
manager.readConfiguration(in);
in.close();
} catch (IOException e) {
System.exit(1);
}
}
} }

View File

@@ -27,29 +27,18 @@ package danielcortes.xyz.data;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Configuration { public class Configuration {
private static final Logger LOGGER = Logger.getLogger(Configuration.class.getName());
private static final Properties config; private static final Properties config;
static { static {
config = new Properties(); config = new Properties();
try { try {
LOGGER.log(Level.INFO, "Leyendo y llenando el objeto de properties");
FileInputStream in = new FileInputStream("config/app.properties"); FileInputStream in = new FileInputStream("config/app.properties");
config.load(in); config.load(in);
in.close(); in.close();
LOGGER.log(Level.INFO, "El objeto de properties se a llenado correctamente");
} catch (IOException e) { } catch (IOException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
System.exit(1); System.exit(1);
} }
} }

View File

@@ -27,14 +27,8 @@ package danielcortes.xyz.data;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteConnectionHolder implements ConnectionHolder { public class SQLiteConnectionHolder implements ConnectionHolder {
private static final Logger LOGGER = Logger.getLogger(Configuration.class.getName());
private String databaseURI; private String databaseURI;
public SQLiteConnectionHolder() { public SQLiteConnectionHolder() {
@@ -48,9 +42,7 @@ public class SQLiteConnectionHolder implements ConnectionHolder {
try { try {
Class.forName("org.sqlite.JDBC"); Class.forName("org.sqlite.JDBC");
con = DriverManager.getConnection(databaseURI); con = DriverManager.getConnection(databaseURI);
LOGGER.log(Level.FINEST, "Creada conexion a base de datos SQLITE");
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
System.exit(133); System.exit(133);
} }

View File

@@ -33,13 +33,8 @@ import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteCajaDAO implements CajaDAO { public class SQLiteCajaDAO implements CajaDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteCajaDAO.class.getName());
private SQLiteConnectionHolder connectionHolder; private SQLiteConnectionHolder connectionHolder;
public SQLiteCajaDAO() { public SQLiteCajaDAO() {
@@ -53,8 +48,6 @@ public class SQLiteCajaDAO implements CajaDAO {
String query = "select * from caja"; String query = "select * from caja";
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0}", new Object[]{query});
while (rs.next()) { while (rs.next()) {
Caja caja = new Caja(); Caja caja = new Caja();
caja.setId(rs.getInt("id")); caja.setId(rs.getInt("id"));
@@ -65,7 +58,6 @@ public class SQLiteCajaDAO implements CajaDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return cajaList; return cajaList;
@@ -79,8 +71,6 @@ public class SQLiteCajaDAO implements CajaDAO {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
ps.setInt(1, id); ps.setInt(1, id);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, id});
while (rs.next()) { while (rs.next()) {
caja = new Caja(); caja = new Caja();
caja.setId(rs.getInt("id")); caja.setId(rs.getInt("id"));
@@ -90,7 +80,6 @@ public class SQLiteCajaDAO implements CajaDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(caja); return Optional.ofNullable(caja);
} }
@@ -103,9 +92,6 @@ public class SQLiteCajaDAO implements CajaDAO {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
ps.setString(1, fecha.toString()); ps.setString(1, fecha.toString());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, fecha});
while (rs.next()) { while (rs.next()) {
caja = new Caja(); caja = new Caja();
caja.setId(rs.getInt("id")); caja.setId(rs.getInt("id"));
@@ -115,7 +101,6 @@ public class SQLiteCajaDAO implements CajaDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(caja); return Optional.ofNullable(caja);
} }
@@ -128,23 +113,17 @@ public class SQLiteCajaDAO implements CajaDAO {
ps.setString(1, caja.getFecha().toString()); ps.setString(1, caja.getFecha().toString());
ps.setInt(2, caja.getFondo()); ps.setInt(2, caja.getFondo());
ps.executeUpdate(); ps.executeUpdate();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}, {2}",
new Object[]{query, caja.getFecha(), caja.getFondo()});
} }
query = "select last_insert_rowid()"; query = "select last_insert_rowid()";
try (PreparedStatement ps = conn.prepareStatement("select last_insert_rowid()")) { try (PreparedStatement ps = conn.prepareStatement("select last_insert_rowid()")) {
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0}", new Object[]{query});
rs.next(); rs.next();
caja.setId(rs.getInt(1)); caja.setId(rs.getInt(1));
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -157,13 +136,8 @@ public class SQLiteCajaDAO implements CajaDAO {
ps.setInt(2, caja.getFondo()); ps.setInt(2, caja.getFondo());
ps.setInt(3, caja.getId()); ps.setInt(3, caja.getId());
ps.executeUpdate(); ps.executeUpdate();
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}, {2}, {3}",
new Object[]{query, caja.getFecha(), caja.getFondo(), caja.getId()});
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
} }

View File

@@ -35,13 +35,8 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteCalculoFondoDAO implements CalculoFondoDAO { public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteCalculoFondoDAO.class.getName());
private ConnectionHolder connectionHolder; private ConnectionHolder connectionHolder;
public SQLiteCalculoFondoDAO() { public SQLiteCalculoFondoDAO() {
@@ -55,8 +50,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
try (Connection conn = connectionHolder.getConnection()) { try (Connection conn = connectionHolder.getConnection()) {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0}", query);
while (rs.next()) { while (rs.next()) {
//Es seguro que exista una caja con ese id, lo dice la base de datos. //Es seguro que exista una caja con ese id, lo dice la base de datos.
@SuppressWarnings("OptionalGetWithoutIsPresent") @SuppressWarnings("OptionalGetWithoutIsPresent")
@@ -73,7 +66,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
} }
} catch ( } catch (
SQLException e) { SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return calculoFondoList; return calculoFondoList;
} }
@@ -90,8 +82,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
ps.setInt(1, caja.getId()); ps.setInt(1, caja.getId());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, caja.getId()});
if (rs.next()) { if (rs.next()) {
CalculoFondo calculoFondo = new CalculoFondo(); CalculoFondo calculoFondo = new CalculoFondo();
@@ -105,7 +95,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return calculoFondoList; return calculoFondoList;
} }
@@ -118,8 +107,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
ps.setInt(1, id); ps.setInt(1, id);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, id});
if (rs.next()) { if (rs.next()) {
//Es seguro que exista una caja con ese id, confio en la base de datos. //Es seguro que exista una caja con ese id, confio en la base de datos.
@SuppressWarnings("OptionalGetWithoutIsPresent") @SuppressWarnings("OptionalGetWithoutIsPresent")
@@ -133,7 +120,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(calculoFondo); return Optional.ofNullable(calculoFondo);
} }
@@ -151,15 +137,12 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
ps.setInt(1, caja.getId()); ps.setInt(1, caja.getId());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, caja.getId()});
if (rs.next()) { if (rs.next()) {
sum = rs.getInt(1); sum = rs.getInt(1);
} }
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return sum; return sum;
@@ -178,14 +161,11 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
try (PreparedStatement ps = conn.prepareStatement("select last_insert_rowid()")) { try (PreparedStatement ps = conn.prepareStatement("select last_insert_rowid()")) {
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "Se ejecuta query: {0}", query);
rs.next(); rs.next();
calculoFondo.setId(rs.getInt(1)); calculoFondo.setId(rs.getInt(1));
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -202,7 +182,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -216,7 +195,6 @@ public class SQLiteCalculoFondoDAO implements CalculoFondoDAO {
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
} }

View File

@@ -35,13 +35,8 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteDocumentosDAO implements DocumentosDAO { public class SQLiteDocumentosDAO implements DocumentosDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteDocumentosDAO.class.getName());
private ConnectionHolder connectionHolder; private ConnectionHolder connectionHolder;
public SQLiteDocumentosDAO() { public SQLiteDocumentosDAO() {
@@ -55,8 +50,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
try (Connection conn = connectionHolder.getConnection()) { try (Connection conn = connectionHolder.getConnection()) {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0}", query);
while (rs.next()) { while (rs.next()) {
//Confio en que la base de datos mapeo correctamente la caja_id //Confio en que la base de datos mapeo correctamente la caja_id
@SuppressWarnings("OptionalGetWithoutIsPresent") @SuppressWarnings("OptionalGetWithoutIsPresent")
@@ -74,7 +67,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return documentosList; return documentosList;
} }
@@ -88,8 +80,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
ps.setInt(1, id); ps.setInt(1, id);
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, id});
if (rs.next()) { if (rs.next()) {
//Confio en que la base de datos mapeo correctamente la caja_id //Confio en que la base de datos mapeo correctamente la caja_id
@SuppressWarnings("OptionalGetWithoutIsPresent") @SuppressWarnings("OptionalGetWithoutIsPresent")
@@ -105,7 +95,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(documentos); return Optional.ofNullable(documentos);
} }
@@ -123,8 +112,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
try (PreparedStatement ps = conn.prepareStatement(query)) { try (PreparedStatement ps = conn.prepareStatement(query)) {
ps.setInt(1, caja.getId()); ps.setInt(1, caja.getId());
try (ResultSet rs = ps.executeQuery()) { try (ResultSet rs = ps.executeQuery()) {
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, caja.getId()});
if (rs.next()) { if (rs.next()) {
documentos = new Documentos(); documentos = new Documentos();
documentos.setCaja(caja); documentos.setCaja(caja);
@@ -136,7 +123,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(documentos); return Optional.ofNullable(documentos);
} }
@@ -159,7 +145,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -184,7 +169,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -203,7 +187,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -220,7 +203,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -232,7 +214,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
ps.setInt(1, documentos.getId()); ps.setInt(1, documentos.getId());
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }

View File

@@ -36,12 +36,8 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteEfectivoDAO implements EfectivoDAO { public class SQLiteEfectivoDAO implements EfectivoDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteEfectivoDAO.class.getName());
private ConnectionHolder connectionHolder; private ConnectionHolder connectionHolder;
public SQLiteEfectivoDAO() { public SQLiteEfectivoDAO() {
@@ -79,7 +75,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return efectivoList; return efectivoList;
@@ -115,7 +110,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(efectivo); return Optional.ofNullable(efectivo);
@@ -150,7 +144,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(efectivo); return Optional.ofNullable(efectivo);
@@ -174,7 +167,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -203,7 +195,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -222,7 +213,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -246,7 +236,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -259,7 +248,6 @@ public class SQLiteEfectivoDAO implements EfectivoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }

View File

@@ -40,12 +40,8 @@ import java.time.YearMonth;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteEgresoDAO implements EgresoDAO { public class SQLiteEgresoDAO implements EgresoDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteEgresoDAO.class.getName());
private ConnectionHolder connectionHolder; private ConnectionHolder connectionHolder;
public SQLiteEgresoDAO() { public SQLiteEgresoDAO() {
@@ -84,7 +80,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return egresoList; return egresoList;
} }
@@ -119,7 +114,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(egreso); return Optional.ofNullable(egreso);
} }
@@ -157,7 +151,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return egresoList; return egresoList;
} }
@@ -194,7 +187,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return egresoList; return egresoList;
} }
@@ -231,7 +223,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return egresoList; return egresoList;
} }
@@ -264,7 +255,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return egresoList; return egresoList;
} }
@@ -288,7 +278,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -316,7 +305,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -340,7 +328,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -358,7 +345,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -371,7 +357,6 @@ public class SQLiteEgresoDAO implements EgresoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }

View File

@@ -10,13 +10,8 @@ import java.time.YearMonth;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO { public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteEstadoResultadoDAO.class.getName());
private SQLiteConnectionHolder connectionHolder; private SQLiteConnectionHolder connectionHolder;
public SQLiteEstadoResultadoDAO() { public SQLiteEstadoResultadoDAO() {
@@ -56,7 +51,6 @@ public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return estadoResultadoList; return estadoResultadoList;
} }
@@ -95,7 +89,6 @@ public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(estadoResultado); return Optional.ofNullable(estadoResultado);
} }
@@ -135,7 +128,6 @@ public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO {
} }
} catch ( } catch (
SQLException e) { SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(estadoResultado); return Optional.ofNullable(estadoResultado);
} }
@@ -173,7 +165,6 @@ public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -205,7 +196,6 @@ public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -218,7 +208,6 @@ public class SQLiteEstadoResultadoDAO implements EstadoResultadoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
} }

View File

@@ -40,12 +40,8 @@ import java.time.YearMonth;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteIngresoDAO implements IngresoDAO { public class SQLiteIngresoDAO implements IngresoDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteIngresoDAO.class.getName());
private ConnectionHolder connectionHolder; private ConnectionHolder connectionHolder;
public SQLiteIngresoDAO() { public SQLiteIngresoDAO() {
@@ -87,7 +83,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return ingresosList; return ingresosList;
@@ -167,7 +162,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} catch ( } catch (
SQLException e) { SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(ingreso); return Optional.ofNullable(ingreso);
} }
@@ -203,7 +197,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return ingresosList; return ingresosList;
} }
@@ -226,7 +219,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -250,7 +242,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -273,7 +264,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -296,7 +286,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return total; return total;
} }
@@ -321,7 +310,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(nroInicial); return Optional.ofNullable(nroInicial);
} }
@@ -345,7 +333,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
e.printStackTrace(); e.printStackTrace();
} }
return Optional.ofNullable(nroFinal); return Optional.ofNullable(nroFinal);
@@ -370,7 +357,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
e.printStackTrace(); e.printStackTrace();
} }
return Optional.ofNullable(nroZInicial); return Optional.ofNullable(nroZInicial);
@@ -393,7 +379,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
e.printStackTrace(); e.printStackTrace();
} }
return Optional.ofNullable(nroZFinal); return Optional.ofNullable(nroZFinal);
@@ -421,7 +406,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -441,7 +425,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
@@ -454,7 +437,6 @@ public class SQLiteIngresoDAO implements IngresoDAO {
ps.executeUpdate(); ps.executeUpdate();
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
} }

View File

@@ -33,12 +33,7 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
public class SQLiteTipoEgresoDAO implements TipoEgresoDAO { public class SQLiteTipoEgresoDAO implements TipoEgresoDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteTipoEgresoDAO.class.getName());
private ConnectionHolder connectionHolder; private ConnectionHolder connectionHolder;
public SQLiteTipoEgresoDAO() { public SQLiteTipoEgresoDAO() {
@@ -61,7 +56,6 @@ public class SQLiteTipoEgresoDAO implements TipoEgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return tipoEgresoList; return tipoEgresoList;
} }
@@ -82,7 +76,6 @@ public class SQLiteTipoEgresoDAO implements TipoEgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(tipoEgreso); return Optional.ofNullable(tipoEgreso);
} }
@@ -103,7 +96,6 @@ public class SQLiteTipoEgresoDAO implements TipoEgresoDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
return Optional.ofNullable(tipoEgreso); return Optional.ofNullable(tipoEgreso);
} }

View File

@@ -33,11 +33,8 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Logger;
public class SQLiteTipoIngresoDAO implements TipoIngresoDAO { public class SQLiteTipoIngresoDAO implements TipoIngresoDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteTipoIngresoDAO.class.getName());
private ConnectionHolder connectionHolder; private ConnectionHolder connectionHolder;
public SQLiteTipoIngresoDAO() { public SQLiteTipoIngresoDAO() {

View File

@@ -12,15 +12,11 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
public class SQLiteVersionDAO extends VersionDAO { public class SQLiteVersionDAO extends VersionDAO {
private static final Logger LOGGER = Logger.getLogger(SQLiteVersionDAO.class.getName());
public SQLiteVersionDAO() { public SQLiteVersionDAO() {
this.connectionHolder = new SQLiteConnectionHolder(); this.connectionHolder = new SQLiteConnectionHolder();
} }
@@ -48,7 +44,6 @@ public class SQLiteVersionDAO extends VersionDAO {
} }
} }
} catch (SQLException e) { } catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
} }
} }
return 0; return 0;
@@ -84,7 +79,6 @@ public class SQLiteVersionDAO extends VersionDAO {
} }
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
LOGGER.log(Level.SEVERE, e.toString(), e);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }