geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Petersson <>
Subject Re: JNDI context
Date Tue, 05 May 2009 07:10:54 GMT
govinda wrote:
> How do I connect to a datasource thru code without context "java:comp/env"
> Context envContext  = (Context)initContext.lookup("java:comp/env");
> I just want to connect to DB like this
> DataSource ds = (DataSource)initContext.lookup("jdbc/LiferayPool");
> Is it possible, if so where do I specify java jndi context ("java:comp/env")
> outside the code?
If I have not misunderstood you last question and although I am not a G 
developer I hope no one minds I jump in an try to help out.

In Liferay there are several ways to set up a database connection but 
you probably want to use Geronimo:s connection pool and sins Liferay 
5.2.2 it is ones again possible to set up the application server 
connection pools JNDI name by specify the following line in your file.

###application server connection pools JNDI name
I am not sure the following is required but I also have this in the end 
of the web.xml file.
    <!-- Geronimo usage -->

Hope this helps.
For more information about this take a look at

    peter petersson

> Thanks

View raw message