Fórum

How to connect with database without service builder

ramakanth reddy, modificado 11 Anos atrás.

How to connect with database without service builder

Junior Member Postagens: 27 Data de Entrada: 17/04/13 Postagens Recentes
Hi

I need to connect to database in life-ray 6.1 without need of service builder,i need to connect to DB with Spring+hibernate configuration ,can anyone help me how to achieve this.

Regards
Ramakanth
thumbnail
Manish Yadav, modificado 11 Anos atrás.

RE: How to connect with database without service builder

Expert Postagens: 493 Data de Entrada: 26/05/12 Postagens Recentes
Hello Ramakanth,
I recommend Portlet In Action book.You can get Step by step tutorial of Portlet Spring MVC with hibernate and using Spring DAO. Each chapter have example source code written in Spring MVC and with both build tools maven and ANT.

Read Chapter 7-8 for spring DAO and Hibernate.

you can download source code of Each chapter from below link
www.manning.com/sarin/PiA_sourcecode.zip
ramakanth reddy, modificado 11 Anos atrás.

RE: How to connect with database without service builder

Junior Member Postagens: 27 Data de Entrada: 17/04/13 Postagens Recentes
Hi Manish

Thanks for your reply ,it helped me a lot and resolved my problem.

One more question,in my application i have ten portlets,can i have single spring and hibernate configuration file for ten portlets.if yes,how can achieve this.please guide me regarding this.
thumbnail
Manish Yadav, modificado 11 Anos atrás.

RE: How to connect with database without service builder

Expert Postagens: 493 Data de Entrada: 26/05/12 Postagens Recentes
Dear Ramakanth,

You can create spring or Hibernate project and write all connection and your CRUD operations then create jar of that project and copy that jar into tomcat lib or your server lib.so you can access same connection in your complete application.

Thanks & Regards
Manish Yadav
Email:- manishyadav1103@gmail.com
Contact No:- +91-8452899010
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: How to connect with database without service builder

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Note that unless you are using a JNDI data source, your 10 portlets will each have their own connection (possibly connection pool) to the database, dramatically increasing the resource consumption on your portal.
ramakanth reddy, modificado 10 Anos atrás.

RE: How to connect with database without service builder

Junior Member Postagens: 27 Data de Entrada: 17/04/13 Postagens Recentes
David H Nebinger:
Note that unless you are using a JNDI data source, your 10 portlets will each have their own connection (possibly connection pool) to the database, dramatically increasing the resource consumption on your portal.



Hi David

Thanks for your reply.

I am having a requirement to connect to database without need of service builder.

Does Liferay provides a way to achieve this without writing external code.

Bcoz if write a code to connect database with hibernate still there will be two open connections 1.liferay and 2.hibernate.



Regards
Ramakanth