Hi,
I am trying to connect to Jboss3.2 & Mysql 3 .I have modified the mysql-ds.xml such that it now reads
<jndi-name>jdbc/MySqlDS</jndi-name>
Have pasted the mysql driver in appropriate places.
When I see the web-console i see the jdbc/MySqlDS under jboss.jca.
The log file also shows JNDI name bound to '
java:/jdbc/MySqlDS'
However when i try to use i from the client as:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming
rg.jnp.interfaces" );
Context ctx = new InitialContext(env);
System.out.println(ctx);
DataSource ds = (DataSource) ctx.lookup("java:/jdbc/MySqlDS");
I get a NameNotBound :
jdbc not bound Exception
I also tried this:
DataSource ds = (DataSource) ctx.lookup("jdbc/MySqlDS");
Still i get the same exception.
Please help.