Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
René Jurmann
Create Database Portlet in Eclipse
17 novembre 2010 7.35
Risposta

René Jurmann

Punteggio: Junior Member

Messaggi: 27

Data di Iscrizione: 15 novembre 2010

Messaggi recenti

Hi all,

I want to create a portlet for Liferay portal 6 which reads data from a certain database. As I use Eclipse (with Lifery IDE) I searched for examples on how to create such a portlet in this environment. Unfortunately, all I found was how to create such portlets using the PDK directly. Furthermore none of those hints I found explained how to configure the database access (I assume the portal's database is used then...).

But I was looking more or less for a step-by-step example on how to create a database portlet in Eclipse. Thereby I want to connect to any database - not necessarily the portal database.

(Use case: I have a database somewhere containing business data. Now I want to display/modify this data via Liferay portal using some portlets.)

Can anyone help me?

regards
René
Pushpinder Singh
RE: Create Database Portlet in Eclipse
17 novembre 2010 14.03
Risposta

Pushpinder Singh

Punteggio: Junior Member

Messaggi: 81

Data di Iscrizione: 21 luglio 2010

Messaggi recenti

René,
Simple way to start supporting database call is first create a normal java application which read database.
Then move all your working database java classes from your java application to your portlet application and call your database classes through your Portlet action class.

If you dont know how to create and configure Portlet action classes, download Liferay IDE and it will create skelton code for you.
René Jurmann
RE: Create Database Portlet in Eclipse
22 novembre 2010 7.30
Risposta

René Jurmann

Punteggio: Junior Member

Messaggi: 27

Data di Iscrizione: 15 novembre 2010

Messaggi recenti

yes, you're of ourse right - that also worked fine.
Thanks
Albert Zaky
RE: Create Database Portlet in Eclipse
9 giugno 2013 5.55
Risposta

Albert Zaky

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 12 maggio 2013

Messaggi recenti

i have same situation here i am a beginner at liferay i have a database mysql and i want to connect to it through liferay can anyone help me ?!
sachin maheshwari
RE: Create Database Portlet in Eclipse
9 giugno 2013 22.10
Risposta

sachin maheshwari

Punteggio: Junior Member

Messaggi: 52

Data di Iscrizione: 4 dicembre 2010

Messaggi recenti

I hope this link will help..!!
Mohamed Faisal
RE: Create Database Portlet in Eclipse
9 giugno 2013 22.30
Risposta

Mohamed Faisal

Punteggio: Junior Member

Messaggi: 56

Data di Iscrizione: 11 agosto 2009

Messaggi recenti

Hi Renu,

Please follow the follwing link MVC Portlet
Albert Zaky
RE: Create Database Portlet in Eclipse
10 giugno 2013 1.37
Risposta

Albert Zaky

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 12 maggio 2013

Messaggi recenti

hey sachin maheshwari the link you gave me was not what i expected after all my searching on Google what i got out with that how to modify the portal-ext.properties file to make it be able to connect to MySQL db and i have already downloaded MySQL db and installed also the lportal schema all what i need now if there is a step by step for how to create a form that takes inputs and search in the lportal tables or insert in them that would be great also it will be useful for me to know how to create text boxes that takes an input in.
thanks a lot i really appreciate your help emoticon
Albert Zaky
RE: Create Database Portlet in Eclipse
12 giugno 2013 4.05
Risposta

Albert Zaky

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 12 maggio 2013

Messaggi recenti

YOU REALLY SAVED ME I JUST DONT KNOW HOW TO THANKS YOU MAN!
TNANKSSSSSSSSSSSSSSS SO MUCH I REALLY REALLY DO APPRECIATE YOUR HELP emoticon
I JUST HAVE ONE THING That when i insert a new book it's inserted and appears in the console that the value is right and when i search for them they comes in a list but i cant find the table created in MySql ??
Albert Zaky
RE: Create Database Portlet in Eclipse
12 giugno 2013 7.23
Risposta

Albert Zaky

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 12 maggio 2013

Messaggi recenti

when i add the book title and author they are succefully added and when i get back to the list page i find them there but when i go to Mysql DB to check the table i cant find nor the table or the data in it .
Isn't it suppose when i write in the service.xml <entity name="Library" local-service="true" remote-service="false"> it creates a table in the database and name it Library ?
bec it didn't
also i tried to create the table with my hand manually but the data is not inserted in it
also here is my portal-ext.properties
jdbc.default.jndi.name=

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=lportal
jdbc.default.password=lportal


can you help ?