@Override
    public Connection getConnection() {
        if (connection == null) {
            try {
                InitialContext context = new InitialContext();
                DataSource ds = ((DataSource) context.lookup("30Resource"));
                connection = ds.getConnection();
            } catch (NamingException | SQLException ex) {
                Logger.getLogger(MySqlFactory.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return connection;
    }