I'm fairly new to using EJB's. I just successfully created a servlet that accessed an entity bean to do a query on a database. It didn't EXACTLY work the way I had hoped, but I did confirm my finder method retrieved data off my database table. I created a CMP bean.
I need help understanding ABSTRACT-SCHEMA-NAME. How do/Can you map a schema name to a physical database table ? At first, I was putting the data base table into the <ABSTRACT-SCHEMA-NAME> attibute on my DD because the schema name is also in the EJB QL query. I found this very confusing.
Then after a while, I noticed an empty table being created when I deployed my EAR to the server. I changed my <ABSTRACT-SCHEMA-NAME> attribute in my DD to match the newly created table, inserted a row on the newly created table, then it worked. But, I'm still puzzled.
Can you do this with BMP beans ? I understand they are a bit more flexible, but YOU have to maintain the database connection code and code your own queries.
Any new insights would be greatly appreciated. Thank You in advanced.
In your <abstract-schema-name> element, you declare your CMP fields. These fields are mapped to the real DB fields by a vendor-supplied tool. This is typically a GUI which enables you to connect to a specific DB and drag and drop your CMP fields to columns in one or more tables. Check your vendor's documentation on how to do this.