4 Replies Latest reply on Oct 18, 2006 11:30 AM by Christian Eckert

    It works but I don't know why!

    Christian Eckert Newbie

      Hi,

      please help me with a technical question:
      Does JBoss automatically wrap a Driver object into a Datasource?


      In "mysql-ds" I specify the jndi-name and the driver for a database:

      <jndi-name>/j2ee</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/j2ee</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>

      But in a servlet I can do this:
      ds = (DataSource)cxt.lookup("java:j2ee")

      That is, the lookup returns a datasource, although the Driver specified in "mysql-ds" does not implement that interface!

      That leads me to the question:
      Does JBoss automatically wrap a Driver object into a Datasource object?
      If yes, where can I find any documentation for this behavior?

      Thanks for any hints
      Christian