Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
ramakanth reddy
How to connect with database without service builder
April 25, 2013 7:26 AM
Answer

ramakanth reddy

Rank: Junior Member

Posts: 28

Join Date: April 17, 2013

Recent Posts

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
Manish Yadav
RE: How to connect with database without service builder
April 25, 2013 7:30 AM
Answer

Manish Yadav

Rank: Expert

Posts: 449

Join Date: May 26, 2012

Recent Posts

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
RE: How to connect with database without service builder
April 26, 2013 12:26 AM
Answer

ramakanth reddy

Rank: Junior Member

Posts: 28

Join Date: April 17, 2013

Recent Posts

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.
Manish Yadav
RE: How to connect with database without service builder
April 26, 2013 1:09 AM
Answer

Manish Yadav

Rank: Expert

Posts: 449

Join Date: May 26, 2012

Recent Posts

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
David H Nebinger
RE: How to connect with database without service builder
April 26, 2013 5:38 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11046

Join Date: September 1, 2006

Recent Posts

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
RE: How to connect with database without service builder
April 28, 2013 9:10 PM
Answer

ramakanth reddy

Rank: Junior Member

Posts: 28

Join Date: April 17, 2013

Recent Posts

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