1 Reply Latest reply on Nov 22, 2003 10:06 PM by danb99

    MySQL Datasource

    danb99 Newbie

      I am trying to set up a Datasource in jboss for MySql, but am getting an exception on the ctx.lookup. Can anyone point out what else I need to do? The exception is 'Receive timed out'. Thanks!

      This is the code I have for getting the DataSource:

      try {
      Context ctx;
      Properties prop = new Properties();
      prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      prop.put( Context.PROVIDER_URL, "Pendjari:1099" );
      prop.put( "java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      ctx = new InitialContext( prop );
      DataSource ds = (DataSource)ctx.lookup("MySqlDS");
      Connection con = ds.getConnection("user", "pwd");
      } catch( Exception e ) {

      And this is the mysql-ds.xml file in the jboss deploy directory: