public Connection createConnection() {
		if (plugin.config.useMySQL) {
			try {
				Class.forName("com.mysql.jdbc.Driver");
				cn = DriverManager.getConnection("jdbc:mysql://" + plugin.config.dbPath, plugin.config.dbUser, plugin.config.dbPassword);
				cn.setAutoCommit(false);
				return cn;
			} catch (SQLException e) {
				plugin.Logger("could not be enabled: Exception occured while trying to connect to DB", "Error");
				SQLErrorHandler(e);
				if (cn != null) {
					plugin.Logger("Old Connection still activated", "Error");
					try {
						cn.close();
						plugin.Logger("Old connection that was still activated has been successfully closed", "Error");
					} catch (SQLException e2) {
						plugin.Logger("Failed to close old connection that was still activated", "Error");
						SQLErrorHandler(e2);
					}
				}
				return null;
			} catch (ClassNotFoundException e) {
				ErrorLogger(e.getMessage());
				return null;
			}
		} else if (!plugin.config.useMySQL) {
			try {
				try {
					Class.forName("org.sqlite.JDBC");
				} catch (ClassNotFoundException cs) {
					ErrorLogger(cs.getMessage());
				}
				cn = DriverManager.getConnection("jdbc:sqlite:plugins" + File.separator + "xpShop" + File.separator + "xpShop.sqlite");
				cn.setAutoCommit(false);
				return cn;
			} catch (SQLException e) {
				SQLErrorHandler(e);
			}
		}
		return null;
	}