CMP and ORACLE database

Discussions

EJB programming & troubleshooting: CMP and ORACLE database

  1. CMP and ORACLE database (3 messages)

    Hi

    Is it possible that we use CMP model with oracle as a database?

    In CMP we use container for the finder method quries.What , if i use ORACLE as my backend.How do i get connection object?If i write code for this in my bean then it is same as using BMP.

    What about load, store methods?Will container be able to get connection automatically(from code) or not?

    please clear my doubt regarding it

    Thanks

    somal

    Threaded Messages (3)

  2. CMP and ORACLE database[ Go to top ]

    Somal,
    U use the connection pool objects in the CMP as the connection objects and they can work with any DB Oracle, SQL Server, MS Access..the only thing is that u have to have proper drivers for the database.
    HTH
    Sahil
  3. CMP and ORACLE database[ Go to top ]

    Hi Somal,

    in case of BMP, developer is supposed to write the state synchronisation methods, which are ejbLoad(), ejbStore etc..
    In case of CMP, these methods are written by container tool, AKA deployment tool.

    in case of CMP, there is not a single line of code to be written by developer for persistence. Just make sure that in ur deployment descriptor (DD) u give appropriate DB connection pool name. That pool can refer to any type of database. DD tools of application server will generate the persistence code for u which will assume that the DB connection pool mentioned in XML will be available at run-time or whenever bean is actually being activated by App server. App server will not deploy the bean, if connection pool is not available.

    to get the connection from connection pool, u have to depend on App server specific coding. If u r using JDBC 2, then there is standard API for getting the connection from connection pool. JDBC 2 has connection pooling support. App servers create connection pooling by their own proprietory way.

    Cheers,
    Kailash
  4. CMP and ORACLE database[ Go to top ]

    hi Kailash and sahil

    thanks for ur response.
    Iam using iPlanet web server for my application.Let me try the connection pooling today.If i encounter any problem i'll post message

    Regards

    somal