4 Replies Latest reply on Sep 27, 2002 12:28 PM by dwightsmith

    EJB bean association to Database/Table


      I have what is probably a stupid newbie question. I'm sorry if I am wasting anyone's time or the Forum's space. If there is documentation that would answer this question please point me in the right direction.

      I have a WebSphere application that we are testing to see what is involved in porting to Jboss. I have an ejb bean that i am deploying to Jboss 3/tomcat 4. I have defined the <table-name> tag in the jaws.xml file that I am deploying with it. In the standardjaws.xml I have defined a tag that corresponds to one that I defined in the oracle_service.xml in the ..\server\default\deploy.

      My question is how is the ejb bean associated with an orale table? How does it know which database and table it is representing? Especially if you want to have connections to different tables with different beans? I inherited a project with one bean that works fine, but there is only one datasource on the server. What if i have another bean that I want to add that represents a different table in a different database? I assume you have to have another XXXX-service.xml file for each URL you want to connect to, but how do you associate a bean to one of these *service.xml so that it connects to the correct table.

      I understand how the JDBC connections (I have made jdbc connections and returned data to JSP's) are made with the linitialcontext lookup for a datasource, but not the mechanics of how the beans are associated with a database table. Is it the name of the bean matching a table name in one of the connected xxxx-service.xml's? What if you have the same table in a different database?

      Is there documentation that would help me understand this?

      Thanks for any help you can give.