See the discussion Toby and I are having - probably not feasible for CMP
(though I haven't done enough with CMP to say authoritatively.)

----- Original Message -----
From: "Greg Parker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 06, 2001 11:02 AM
Subject: [JBoss-user] RE: (JBoss-user) Oracle Authentication


> Thank you for your assistance.
> I want to make sure I understand the implications of this.
> If going I'm to establish my own connection string within the bean, this
implies
> that I will be writing my own SQL code to go with it. Does this imply I
can not
> implement CMP, only BMP or Session beans?
>
> Thank you,
> Greg Parker
>
>
>  -----Original Message-----
> From:      <[EMAIL PROTECTED]> at Internet
> Sent:     Friday, April 06, 2001 5:46 PM
> To:     [EMAIL PROTECTED] at Internet
> Subject:     RE: [JBoss-user] Oracle Authentication
>
>  << File: RFC822.TXT >> Guy Rouillier wrote:
>
> > I think J2EE (and JBoss) handle this, though I may have found a bug in
>
> You are quite right that the spec allows this. Apologies for the
> misinformation.
>
> The relevent section of the EJB2.0 spec that I have is 19.4.
>
> > JBoss.  In jboss.jcml, when you create your connection pool, provide a
URL
> > but do not provide a userid or password.  The MBean will start up
> > successfully.  In your bean code, use this form of connect statement:
> >
> >    Connection connection = ((DataSource)new
> >
InitialContext().lookup("java:comp/env/jdbc/OracleDB")).getConnection("myuse
> > rid", "mypassword");
> >
> > Now your connection will use the credentials of the userid provided.
I've
> > tried this and it seems to work
>
> Now, JBoss's support of this is obtained from Minerva. Looking at the
> code for XAPoolDataSource, we see:
>
>     /**
>      * Gets a new connection from the pool.  If a new connection must be
>      * created, it will use the specified user name and password.  If
there is
>      * a connection available in the pool, it will be used, regardless of
the
>      * user name and password use to created it initially.
>      */
>     public Connection getConnection(String user, String password) throws
> java.sql.SQLException {
>         if(!initialized) initialize();
>         factory.setUser(user);
>         factory.setPassword(password);
>         return ((XAConnection)pool.getObject()).getConnection();
>     }
>
> So, Minerva does not do what you might expect, unless you are never
> returning your connections to the pool.
>
> This is superceded by the JCA stuff, which knows how to handle the case
> of requesting connections on behalf of different principals.
>
> Toby.
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to