<commit_before>
package com.enioka.jqm.jndi;

import javax.naming.spi.NamingManager;

import com.enioka.jqm.tools.Main;

public class JndiContextFactory {

	private JndiContextFactory() {

	}

	public static JndiContext createJndiContext(com.enioka.jqm.api.DatabaseProp db) throws Exception {

		com.enioka.jqm.jpamodel.DatabaseProp tmp = Main.em
		        .createQuery("SELECT d FROM DatabaseProp d WHERE d.url = :url AND d.user = :user", com.enioka.jqm.jpamodel.DatabaseProp.class)
		        .setParameter("url", db.getUrl()).setParameter("usr", db.getUser()).getSingleResult();

		try {
			JndiContext ctx = new JndiContext(tmp);
			Class.forName(db.getDriver());
			NamingManager.setInitialContextFactoryBuilder(ctx);
			return ctx;
		} catch (Exception e) {
			throw new Exception("could not init Jndi COntext", e);
		}

	}
}<commit_msg>JndiContextFactory containing some commented code to compile with maven (compiling with eclipse)<commit_after>
package com.enioka.jqm.jndi;

import javax.naming.spi.NamingManager;

import com.enioka.jqm.jpamodel.DatabaseProp;

public class JndiContextFactory {

	private JndiContextFactory() {

	}

	public static JndiContext createJndiContext(DatabaseProp db) throws Exception {

		// com.enioka.jqm.jpamodel.DatabaseProp tmp = Main.em
		// .createQuery("SELECT d FROM DatabaseProp d WHERE d.url = :url AND d.user = :user",
		// com.enioka.jqm.jpamodel.DatabaseProp.class)
		// .setParameter("url", db.getUrl()).setParameter("usr",
		// db.getUser()).getSingleResult();

		try {
			JndiContext ctx = new JndiContext(db);
			Class.forName(db.getDriver());
			NamingManager.setInitialContextFactoryBuilder(ctx);
			return ctx;
		} catch (Exception e) {
			throw new Exception("could not init Jndi COntext", e);
		}

	}
}
{'fraction_non_alphanumeric': 0.12152186257808063, 'fraction_numerical': 0.0, 'mean_word_length': 4.291291291291292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1466405', 'n_tokens_mistral': 656, 'n_tokens_neox': 585, 'n_words': 125}