[jboss-user] [JCA/JBoss] - Access Connection Pool from standalone

Uchiha do-not-reply at jboss.com
Wed Feb 7 10:45:27 EST 2007


Hi I need to access the connection pool in JBoss from a standalone program, im getting the context through JNDI like this:

Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
env.setProperty(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");

Context ctx = new InitialContext(env);
DataSource ds = (DataSource) ctx.lookup("java:SybaseDS");
Connection conn = ds.getConnection();

i'm getting the error that SybaseDS is not bound, however, at Jboss startup "java:SybaseDS" is well registered.

Someone told me that I need to configure Jboss to let standalone programs access the connection pool from outside the server, could you please tell me how can i do that, I'd really apreciate your help.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012496#4012496

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012496



More information about the jboss-user mailing list