Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
sudhansu rana
How to use existing tables of a database in liferay 6.1
30 ottobre 2012 23.12
Risposta

sudhansu rana

Punteggio: New Member

Messaggi: 8

Data di Iscrizione: 21 agosto 2012

Messaggi recenti

Hi,
I am new to liferay.
I have an existing database and some table names which are fixed and cannot be changed.
They don't follow any Namespace so i cannot use service builder.(like abc and not with namespace PR pr_abc)

Please advice how to use them either in service builder or spring+hibernate.

Thanks
Sudhansu
Harish Kumar
RE: How to use existing tables of a database in liferay 6.1
30 ottobre 2012 23.44
Risposta

Harish Kumar

Punteggio: Expert

Messaggi: 324

Data di Iscrizione: 31 luglio 2010

Messaggi recenti

1http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Connecting+to+Separate+Database+Using+Build-service+in+Plugins+SDK
Jignesh Vachhani
RE: How to use existing tables of a database in liferay 6.1
31 ottobre 2012 0.11
Risposta

Jignesh Vachhani

Punteggio: Liferay Master

Messaggi: 772

Data di Iscrizione: 10 marzo 2008

Messaggi recenti

Hi Sudhansu,
If its compolsary to use separate database then you can follow the link send by Haris.
Otherwise if table value is fixed and won't change anymore, then you can copy those tables in liferay DB and then try with my below approach.

I didn't try with table but i tried with view.
In that i created sql view and then i created service with the same name of view and access the data from that view using service builder only.
But here you need to make sure that entity name should be same as view or table name.
Please try and put your feedback here.
Nikhil Nishchal
RE: How to use existing tables of a database in liferay 6.1
31 ottobre 2012 0.27
Risposta

Nikhil Nishchal

Punteggio: Junior Member

Messaggi: 74

Data di Iscrizione: 21 giugno 2012

Messaggi recenti

Hello sudhansu rana,
For Connecting to a Database with Plugins SDK you can use above link given by Harish.
However,
If you existing table is going to use only once while importing data to liferay.
then you can do these steps:
make a portlet in liferay.
in this portlet read data from existing table using JDBC.
And, then using liferayservice add them to liferay as per requirement.
sudhansu rana
RE: How to use existing tables of a database in liferay 6.1
31 ottobre 2012 1.01
Risposta

sudhansu rana

Punteggio: New Member

Messaggi: 8

Data di Iscrizione: 21 agosto 2012

Messaggi recenti

Harish Kumar:
1http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Connecting+to+Separate+Database+Using+Build-service+in+Plugins+SDK



Hi Harish,

The sample seems to made in liferay 5.2.

Is there any sample for liferay 6.1.

Could you please guide me on this?
Harish Kumar
RE: How to use existing tables of a database in liferay 6.1
31 ottobre 2012 2.43
Risposta

Harish Kumar

Punteggio: Expert

Messaggi: 324

Data di Iscrizione: 31 luglio 2010

Messaggi recenti

http://liferayazam.wordpress.com/2011/05/30/connect-to-different-database-through-service-xml-liferay6/
sudhansu rana
RE: How to use existing tables of a database in liferay 6.1
14 dicembre 2012 6.47
Risposta

sudhansu rana

Punteggio: New Member

Messaggi: 8

Data di Iscrizione: 21 agosto 2012

Messaggi recenti

Thanks friends.
I could connect to different DB from portlet.