// Path: src/main/java/de/simonsator/partyandfriends/communication/sql/DBCommunication.java
// public class DBCommunication {
// 	protected final String MYSQL_DRIVER_CLASS;
// 
// 	protected DBCommunication() {
// 		String mysqlDriverClass = "com.mysql.cj.jdbc.Driver";
// 		try {
// 			Class.forName(mysqlDriverClass);
// 		} catch (ClassNotFoundException e) {
// 			mysqlDriverClass = "com.mysql.jdbc.Driver";
// 		}
// 		MYSQL_DRIVER_CLASS = mysqlDriverClass;
// 	}
// 
// 	protected void close(PreparedStatement pPrepStmt) {
// 		try {
// 			if (pPrepStmt != null)
// 				pPrepStmt.close();
// 		} catch (SQLException e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	protected void close(ResultSet rs, Statement stmt) {
// 		try {
// 			if (rs != null)
// 				rs.close();
// 			if (stmt != null)
// 				stmt.close();
// 		} catch (SQLException e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	protected void close(ResultSet rs, Statement stmt, PreparedStatement prepStmt) {
// 		try {
// 			if (rs != null)
// 				rs.close();
// 			if (stmt != null)
// 				stmt.close();
// 			if (prepStmt != null)
// 				prepStmt.close();
// 		} catch (SQLException e) {
// 			e.printStackTrace();
// 		}
// 	}
// }
// 
// Path: src/main/java/de/simonsator/partyandfriends/communication/sql/MySQLData.java
// public class MySQLData {
// 	public final String HOST;
// 	public final String USERNAME;
// 	public final String PASSWORD;
// 	public final int PORT;
// 	public final String DATABASE;
// 	public final String TABLE_PREFIX;
// 	public final boolean USE_SSL;
// 	public final boolean CACHE;
// 	public final int EXPIRATION_TIME;
// 	public final boolean EXPIRATION_ACTIVATED;
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = false;
// 		CACHE = true;
// 		EXPIRATION_ACTIVATED = false;
// 		EXPIRATION_TIME = 0;
// 	}
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix, boolean pUseSSL) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = pUseSSL;
// 		CACHE = true;
// 		EXPIRATION_ACTIVATED = false;
// 		EXPIRATION_TIME = 0;
// 	}
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix, boolean pUseSSL, boolean pCache) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = pUseSSL;
// 		CACHE = pCache;
// 		EXPIRATION_ACTIVATED = false;
// 		EXPIRATION_TIME = 0;
// 	}
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix, boolean pUseSSL, boolean pCache, boolean pExpirationActivated, int pExpirationTime) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = pUseSSL;
// 		CACHE = pCache;
// 		EXPIRATION_ACTIVATED = pExpirationActivated;
// 		EXPIRATION_TIME = pExpirationTime;
// 	}
// 
// }
// 
// Path: src/main/java/de/simonsator/partyandfriends/utilities/disable/Deactivated.java
// public interface Deactivated {
// 	void onDisable();
// }
// 
// Path: src/main/java/de/simonsator/partyandfriends/utilities/disable/Disabler.java
// public class Disabler {
// 	private static Disabler instance = null;
// 	private final List<Deactivated> toDisable = new ArrayList<>();
// 
// 	public static Disabler getInstance() {
// 		if (instance != null) return instance;
// 		return instance = new Disabler();
// 	}
// 
// 	public void disableAll() {
// 		for (Deactivated toDeactivated : toDisable)
// 			toDeactivated.onDisable();
// 	}
// 
// 	public void registerDeactivated(Deactivated pDeactivated) {
// 		toDisable.add(pDeactivated);
// 	}
// 
// }


import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import de.simonsator.partyandfriends.communication.sql.DBCommunication;
import de.simonsator.partyandfriends.communication.sql.MySQLData;
import de.simonsator.partyandfriends.utilities.disable.Deactivated;
import de.simonsator.partyandfriends.utilities.disable.Disabler;
import java.beans.PropertyVetoException;
import java.sql.*;
import java.util.Properties;
package de.simonsator.partyandfriends.communication.sql.pool;



/**
 * @author simonbrungs
 * @version 1.0.0 11.04.17
 */
public class PoolSQLCommunication extends DBCommunication implements Deactivated {
	private static ComboPooledDataSource cpds;
	private static HikariDataSource hikariDataSource;
	private final MySQLData MYSQL_DATA;
	private final PoolData POOL_DATA;
	private final Properties connectionProperties;

// Path: src/main/java/de/simonsator/partyandfriends/communication/sql/DBCommunication.java
// public class DBCommunication {
// 	protected final String MYSQL_DRIVER_CLASS;
// 
// 	protected DBCommunication() {
// 		String mysqlDriverClass = "com.mysql.cj.jdbc.Driver";
// 		try {
// 			Class.forName(mysqlDriverClass);
// 		} catch (ClassNotFoundException e) {
// 			mysqlDriverClass = "com.mysql.jdbc.Driver";
// 		}
// 		MYSQL_DRIVER_CLASS = mysqlDriverClass;
// 	}
// 
// 	protected void close(PreparedStatement pPrepStmt) {
// 		try {
// 			if (pPrepStmt != null)
// 				pPrepStmt.close();
// 		} catch (SQLException e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	protected void close(ResultSet rs, Statement stmt) {
// 		try {
// 			if (rs != null)
// 				rs.close();
// 			if (stmt != null)
// 				stmt.close();
// 		} catch (SQLException e) {
// 			e.printStackTrace();
// 		}
// 	}
// 
// 	protected void close(ResultSet rs, Statement stmt, PreparedStatement prepStmt) {
// 		try {
// 			if (rs != null)
// 				rs.close();
// 			if (stmt != null)
// 				stmt.close();
// 			if (prepStmt != null)
// 				prepStmt.close();
// 		} catch (SQLException e) {
// 			e.printStackTrace();
// 		}
// 	}
// }
// 
// Path: src/main/java/de/simonsator/partyandfriends/communication/sql/MySQLData.java
// public class MySQLData {
// 	public final String HOST;
// 	public final String USERNAME;
// 	public final String PASSWORD;
// 	public final int PORT;
// 	public final String DATABASE;
// 	public final String TABLE_PREFIX;
// 	public final boolean USE_SSL;
// 	public final boolean CACHE;
// 	public final int EXPIRATION_TIME;
// 	public final boolean EXPIRATION_ACTIVATED;
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = false;
// 		CACHE = true;
// 		EXPIRATION_ACTIVATED = false;
// 		EXPIRATION_TIME = 0;
// 	}
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix, boolean pUseSSL) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = pUseSSL;
// 		CACHE = true;
// 		EXPIRATION_ACTIVATED = false;
// 		EXPIRATION_TIME = 0;
// 	}
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix, boolean pUseSSL, boolean pCache) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = pUseSSL;
// 		CACHE = pCache;
// 		EXPIRATION_ACTIVATED = false;
// 		EXPIRATION_TIME = 0;
// 	}
// 
// 	public MySQLData(String host, String username, String password, int port, String database, String pTablePrefix, boolean pUseSSL, boolean pCache, boolean pExpirationActivated, int pExpirationTime) {
// 		HOST = host;
// 		USERNAME = username;
// 		PASSWORD = password;
// 		PORT = port;
// 		DATABASE = database;
// 		TABLE_PREFIX = pTablePrefix;
// 		USE_SSL = pUseSSL;
// 		CACHE = pCache;
// 		EXPIRATION_ACTIVATED = pExpirationActivated;
// 		EXPIRATION_TIME = pExpirationTime;
// 	}
// 
// }
// 
// Path: src/main/java/de/simonsator/partyandfriends/utilities/disable/Deactivated.java
// public interface Deactivated {
// 	void onDisable();
// }
// 
// Path: src/main/java/de/simonsator/partyandfriends/utilities/disable/Disabler.java
// public class Disabler {
// 	private static Disabler instance = null;
// 	private final List<Deactivated> toDisable = new ArrayList<>();
// 
// 	public static Disabler getInstance() {
// 		if (instance != null) return instance;
// 		return instance = new Disabler();
// 	}
// 
// 	public void disableAll() {
// 		for (Deactivated toDeactivated : toDisable)
// 			toDeactivated.onDisable();
// 	}
// 
// 	public void registerDeactivated(Deactivated pDeactivated) {
// 		toDisable.add(pDeactivated);
// 	}
// 
// }


// Path: src/main/java/de/simonsator/partyandfriends/communication/sql/pool/PoolSQLCommunication.java
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import de.simonsator.partyandfriends.communication.sql.DBCommunication;
import de.simonsator.partyandfriends.communication.sql.MySQLData;
import de.simonsator.partyandfriends.utilities.disable.Deactivated;
import de.simonsator.partyandfriends.utilities.disable.Disabler;
import java.beans.PropertyVetoException;
import java.sql.*;
import java.util.Properties;

package de.simonsator.partyandfriends.communication.sql.pool;



/**
 * @author simonbrungs
 * @version 1.0.0 11.04.17
 */
public class PoolSQLCommunication extends DBCommunication implements Deactivated {
	private static ComboPooledDataSource cpds;
	private static HikariDataSource hikariDataSource;
	private final MySQLData MYSQL_DATA;
	private final PoolData POOL_DATA;
	private final Properties connectionProperties;

	public PoolSQLCommunication(MySQLData pMySQLData, PoolData pPoolData) throws SQLException {