Fórumok

Nyitólap » Liferay Portal » English » 3. Development

Kombinált nézet Egyszerű nézet Fa-nézet
Szálak [ Előző | Következő ]
toggle
Daniel Breitner
How to access the database from a portlet ?
2010. december 8. 6:06
Válasz

Daniel Breitner

Rangsorolás: Junior Member

Hozzászólások: 83

Csatlakozás dátuma: 2008. július 16.

Legújabb hozzászólások

hello everybody -

I want to store some informations about my portlet in the database (for example the state of the portlet).

I have already defined the database in my liferay-ds.xml file and now I want to access the database from one of my Controller - POJOs.

Now my question:

How do I access this database without defining everything again?





-------------
http://liferay-blogging.blogspot.com
Daniel Breitner
[SOLVED] RE: How to access the database from a portlet
2010. december 8. 6:06
Válasz

Daniel Breitner

Rangsorolás: Junior Member

Hozzászólások: 83

Csatlakozás dátuma: 2008. július 16.

Legújabb hozzászólások

Ok, I found it:

DataSource dataSource = com.liferay.portal.kernel.jndi.PortalJNDIUtil.getDataSource();
Connection con = dataSource.getConnection();

emoticon





-------------
http://liferay-blogging.blogspot.com
Secret Developer
RE: [SOLVED] RE: How to access the database from a portlet
2009. szeptember 18. 9:59
Válasz

Secret Developer

Rangsorolás: Expert

Hozzászólások: 278

Csatlakozás dátuma: 2009. június 23.

Legújabb hozzászólások

Hi,

I'm trying to access the tables in the database. How would I do that after establishing the connection?

Baris