"jae77" wrote : http://java.sun.com/j2ee/1.4/docs/tutorial/doc/ 

Yea... that doesn't help much.  I saw the following in Chapter 31...

Specify the logical name of the database.
  private String dbName
    = "java:comp/env/jdbc/SavingsAccountDB"; 

The java:comp/env portion of the logical name is the environment naming context of the 
component. The jdbc/SavingsAccountDB string is the resource reference name (sometimes 
referred to as the coded name). In deploytool, you specify the resource reference name 
and then map it to the JNDI name of the DataSource object. 

Obtain the DataSource object associated with the logical name.
  InitialContext ic = new InitialContext(); 
  DataSource ds = (DataSource) ic.lookup(dbName); 

Given the logical name for the resource, the lookup method returns the DataSource 
object that is bound to the JNDI name in the directory. 

Get the Connection object from the DataSource object.
  Connection con = ds.getConnection(); 

Still, that doesn't address the fact that JBoss doesn't bind the JDBC info in JNDI 
where it can be accessed directly.  I know that directly accessing the DB is 
discouraged, which I agree with, but I have rare case where it is needed.  To do this, 
I've been directly reading the datasource info in the DS XML file, but I would have 
preferred to lookup the info directly in JNDI.


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3828725#3828725

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3828725


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to