1 Reply Latest reply on Oct 3, 2002 7:58 AM by balteo

    MySqlDS not bound

    balteo

      Hello,

      I have installed the MySQL driver together with the resource adapter and my MYSQL database seems to be installed properly. When I try to access it through a JSP using JNDI as follows:

      ********************
      String dbName = "java:comp/env/MySqlDS";
      Connection con;
      InitialContext ic = new InitialContext();
      DataSource ds = (DataSource) ic.lookup(dbName);
      con = ds.getConnection();
      ********************
      I get a "javax.naming.NameNotFoundException: MySqlDS not bound" error.

      What am I getting wrong here?

      Thanks in advance,

      Balteo.

        • 1. MySqlDS not bound
          balteo

          I sorted it! JBoss deploys databasources using the following jndi prefix: "java:/MySqlDS" for a DS named MySqlDS.
          The "comp/env" part is not required.
          Balteo