Skip to content

Instantly share code, notes, and snippets.

@ricky100
Created December 4, 2012 06:15
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
try {
Context ctx = new InitialContext(props);
DataSource ds = (DataSource) ctx.lookup("java:jboss/datasources/ConcordeDS");
connection = ds.getConnection();
} catch (Exception e) {
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment