2 Replies Latest reply on Oct 30, 2002 9:10 PM by Joel Vogt

    CMP how do I indicate which database to use

    mBird Newbie

      I can't see how this could work -- could someone please explain:

      I deploy my ejb. None of the files (see below) tell the ejb what database to use (non of them have a jndi name indicating the db) yet it works.

      So the question is, given the below, how does the ejb know what database conenction to use if you do not specify it in any of your deployed xml files?

      1.) I have MySQL connected to JBoss (...-service.xml and ...-jdbc.xml file) -- works fine
      2.) I create simple Entity bean (Test.java, TestBean.java, TestHome.java)
      3.) I create ejb-jar.xml
      4.) That's it -- no other files -- I package up into a jar and deploy to JBoss (just copy it to the deploy dir)
      5.) I make a simple java client

      The deploy works and the client works -- yet I never told JBoss what db to use???

      The deployable jar is at http://www.mattkelli.com/download/MySQLds1.jar -- if you unjar it you will see only my four files.

      Note the ejb-jar.xml file does not indicate a database
      as you see below

      <?xml version = '1.0' encoding = 'windows-1252'?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      Entity Bean ( CMP )