> Server part:
> - ejb-jar.xml is the dd for all ejbs. This is
> jboss independent.
> - jboss.xml is typical jboss? one also puts the
> jndi's names in this file for every beans.
Correct, if you don't provide a jboss.xml the server will try to default to
the names you provide in the spec compliant ejb-jar.xml. In other words, if
you don't provide a jboss.xml giving the names it should still work.
> Database conn:
> I have 2 choices to use a database connection:
> 1. First I put my database connection, e.g. "Interbase"
> in jboss.conf file and after this
> I can access it through DataSourceImpl,
> because jboss.conf properties map to the parametres of
> org.jboss.jdbc.DataSourceImpl. Is this correct?
>
> For example: I can get the connection like this:
>
> InitialContext ic = new InitialContext();
> DataSource ds = (DataSource)ic.lookup("Interbase");
> con = ds.getConnection();
>
> But this is only interesting, if I want to write
> BMP or session beans, right?
> I can't use this technique to write CMP beans.
Well, if you use CMP it is because you would want to avoid looking up the
context and the database manually.
Part of the EJB magic (most of it actually) is that if you create a bean
"Customer" with fields that represent it's state and deploy on jboss (or any
EJB 1.1 compliant container) and the container will create the database
representation for you (jaws will do that automatically if you don't specify
anything) so that you NEVER have to worry about the database at all. In the
future, and EJB 2.0 optimizes the way CMP works, it might be that users
treat the database as just "another persistence service" seen through the
container only. And the database is gone...right... In other words, you
could get the InitialContext and lookup the tables manually from your beans,
nothing prevents you from doing it, but tell me why would you want to do
that if you decided CMP. the point is that you never need to do that, but if
you want to... go ahead.
> 2. To write CMP beans I think I need JAWS jaws.xml, is
> this correct? But I can't figure out, how I can
> access more than one DB at one time? Because jaws.xml
> only gives you one datasource, like this:
>
> <datasource>Hypersonic</datasource>
> <type-mapping>Hypersonic SQL</type-mapping>
>
Right now we only specify one database, there is not much preventing us from
declaring several database pools with Minerva and having the registration
under the datasource name.
regards
marc
>
> Thank's a lot for your helps!
>
> BTW.: Rickard, I cannot compile your client program because
> this file is missing: MBeanRegistration. This file is used
> by the main.java file
>
> ...
> public class Main
> implements MainMBean, MBeanRegistration
> ...
>
> But it's okay, I just wrote my own simple client program and
> it works!
>
> Thank's!
> --
> ---------------------------------------------------
> Blasius Lofi Dewanto
> ---------------------------------------------------
> Homepage : http://members.tripod.com/~dewanto
> E-Mail : [EMAIL PROTECTED]
> ICQ : 39343280
> ---------------------------------------------------
>
>
> __________________________________________________________________
> Do You Yahoo!?
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Yahoo! Auktionen - gleich ausprobieren - http://auktionen.yahoo.de
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]