@@ -0,0 +1,980 @@
+package dao;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0Aimport java.sql.SQLException;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;%0A%0Apublic class DBConnectionImpl implements DBConnection %7B%0A%0A%09Logger logger = Logger.getLogger(DBConnectionImpl.class%0A%09%09%09.getName());%0A%0A%09private String database, user, pass;%0A%0A%09public DBConnectionImpl(String database, String user, String pass) %7B%0A%09%09this.database = database;%0A%09%09this.user = user;%0A%09%09this.pass = pass;%0A%09%7D%0A%0A%09@Override%0A%09public Connection connectToDatabaseOrDie() %7B%0A%09%09Connection conn = null;%0A%09%09try %7B%0A%09%09%09Class.forName(%22org.postgresql.Driver%22);%0A%09%09%09String url = %22jdbc:postgresql://localhost/%22 + database;%0A%09%09%09conn = DriverManager.getConnection(url, user, pass);%0A%09%09%7D catch (ClassNotFoundException event) %7B%0A%09%09%09logger.log(Level.SEVERE, event.getMessage(), event);%0A%09%09%09System.exit(1);%0A%09%09%7D catch (SQLException event) %7B%0A%09%09%09logger.log(Level.SEVERE, event.getMessage(), event);%0A%09%09%09System.exit(2);%0A%09%09%7D%0A%09%09return conn;%0A%09%7D%0A%7D%0A

Add db connetor impl