Hi!

Have you managed to set up your connection pool properly?  If so, then see
my earlier message about accessing the connection pool through JNDI.  Here
is a bit of code that works for me:

        Connection getConnection() {

        Connection conn = null;

        try {
                ussweb.system.System sys = new ussweb.system.System();
                Context initCtx = new InitialContext();
                javax.sql.DataSource ds =
(javax.sql.DataSource)initCtx.lookup("java:comp/env/jdbc/usswebPool");
                conn = ds.getConnection();
//              Class.forName("org.jboss.minerva.datasource.PoolDriver");
//              conn =
DriverManager.getConnection("jdbc:minerva:usswebPool");
        }
        catch( NamingException n ) {
                n.printStackTrace();
        }
        catch( Exception e ) {
                e.printStackTrace();
        }

You have to setup a resource in ejb-jar.xml and a resource manager that
points to the resource in jBoss.xml.  I can provide instructions on this if
you have problems setting it up.

Note the commented out lines on the PoolDriver.  I get a
ClassNotFoundException when trying to use that bit of code.

Wes

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 20, 2000 11:46 AM
To: [EMAIL PROTECTED]
Subject: [jBoss-User] 


Hi all !

Does anyone know how to get hold of a JDBC connection of a connection pool 
through JNDI ?

(The example given in the documentation does not seem to work...)

Thanks !

XS.



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to