@@ -0,0 +1,1478 @@
+package com.github.aureliano.verbum_domini.db;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0A%0Aimport com.github.aureliano.verbum_domini.AppConfiguration;%0Aimport com.github.aureliano.verbum_domini.exception.VerbumDominiException;%0A%0Apublic class ConnectionSingleton %7B%0A%0A%09private static ConnectionSingleton instance;%0A%09%0A%09private Connection connection;%0A%09%0A%09private ConnectionSingleton() %7B%0A%09%09this.createConnection();%0A%09%7D%0A%09%0A%09public static ConnectionSingleton instance() %7B%0A%09%09if (instance == null) %7B%0A%09%09%09instance = new ConnectionSingleton();%0A%09%09%7D%0A%09%09%0A%09%09return instance;%0A%09%7D%0A%09%0A%09public Connection getConnection() %7B%0A%09%09return this.connection;%0A%09%7D%0A%09%0A%09private void createConnection() %7B%0A%09%09AppConfiguration config = AppConfiguration.instance();%0A%09%09String driver = config.getProperty(%22jdbc.driver_name%22);%0A%09%09if (driver == null) %7B%0A%09%09%09this.throwUnsetPropertyException(%22jdbc.driver_name%22);%0A%09%09%7D%0A%09%09%0A%09%09String url = config.getProperty(%22jdbc.connection.url%22);%0A%09%09if (url == null) %7B%0A%09%09%09this.throwUnsetPropertyException(%22jdbc.connection.url%22);%0A%09%09%7D%0A%09%09%0A%09%09String user = config.getProperty(%22jdbc.connection.user%22);%0A%09%09String password = config.getProperty(%22jdbc.connection.password%22);%0A%09%09%0A%09%09try %7B%0A%09%09%09Class.forName(driver);%0A%09%09%09this.connection = DriverManager.getConnection(url, user, password);%0A%09%09%7D catch (Exception ex) %7B%0A%09%09%09%0A%09%09%7D%0A%09%7D%0A%09%0A%09private void throwUnsetPropertyException(String property) %7B%0A%09%09throw new VerbumDominiException(%22Property '%22 + property + %22' not set in app-configuration.properties file.%22);%0A%09%7D%0A%7D

Create connection singleton.