1 Reply Latest reply on Dec 19, 2002 3:46 PM by Andy

    How to map EJB names to DB table names of my choosing?

    fumeishi Newbie

      Hello everyone, I'm a newbie.

      Can anyone tell me how to map EJB names to db table names of my choosing?


      Using Oracle9i and JBOSS 3.0.2 to implement a J2EE Web application. Until recently, I've been using mySQL, but just started my efforts to migrate to Oracle.

      On startup, my web app creates a number of tables via JDBC. It's able to do so without a problem under mySQL, but runs into a problem with Oracle:

      java.sql.SQLException: ORA-00972: identifier is too long.

      I've since learned that this is due to a limitation of Oracle where schema objects must be <=30 characters in length. And, in fact, I have three EJBs whose names exceed that, so I'm happy to understand the nature of my problem there.

      I don't know whether or not that 30 char limit is insurmountable, but I'd like to fix the problem by designating table names of my choosing. I know that with weblogic, for example, there's an XML file (weblogic-cmp-rdbms-jar.xml) that allows me to make this kind of mapping. Can anyone tell me if there's a JBOSS equivalent?

      Thanks a lot in advance.

        • 1. Re: How to map EJB names to DB table names of my choosing?
          Andy Newbie


          with JBoss you need a file jbosscmp-jdbc.xml

          Here's a snippet of the types of things to include ... (look in the DTD file referenced for the definition).

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE jbosscmp-jdbc PUBLIC
          "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"


          <datasource-mapping>Hypersonic SQL</datasource-mapping>

          <!-- AccountBean DB table mapping -->



          So you can specify the DB table name, and the column names, the SQL types (this is optional), etc.