java2db

How to Connect Liferay 7 to PostgreSQL ( Java Liferay portlet and PostgreSQL integration )



Liferay is a open source and free enterprise portal . It provides robust platform to build our site on quickly and serve to all clients,be they desktop , mobile , or anything in between it provides all the standard applications you need to run on your site and it provides an easy to use development framework for new applications or customization.It provides flexibility to interact with various database platforms .In this post we explained that how to Connect Liferay 7 to PostgreSQL .


How to Connect Liferay 7 to PostgreSQL Basic Requirements  to Connect Liferay 7 to PostgreSQL :

Java 8 (Download).
PostgreSQL (Download).

 

Download the Liferay Bundle from  https://www.liferay.com/downloads/ .

Once we downloaded the bundle , we get all the below stuff .

Jsp , struts 2 example in eclipse Tomcat web server
Jsp , struts 2 example in eclipse Eclipse Neon
Jsp , struts 2 example in eclipse liferay-plugins-sdk-7.0
Jsp , struts 2 example in eclipse liferay-ce-portal-7.0-ga3  (Tomcat has placed in this directory).

 

How to Connect Liferay 7 to PostgreSQL Steps to Connect Liferay 7 to PostgreSQL :

Jsp , struts 2 example in eclipse Step 1 :

Add the liferay-plugins-sdk-7.0 to eclipse IDE

 

 

Jsp , struts 2 example in eclipse Step 2 :

Create a Liferay plug in project (File -> New -> Liferay Plugin Project).

 

How to Connect Liferay 7 to PostgreSQL
Jsp , struts 2 example in eclipse Step 3:

Create a portlet (Right click on src folder -> New – > Liferay Portlet) and copy the below code.

The entire directory structure as follows
How to Connect Liferay 7 to PostgreSQL

 

 

EmployeeSubmitForm.java

 

Jsp , struts 2 example in eclipse Step : 4

Create a jsp file (under docroot folder) to enter input data.

view.jsp

 

Jsp , struts 2 example in eclipse Step 5 :

Create a java class that can handle database operations

DBUtil.java

 

Jsp , struts 2 example in eclipse Step 6:

Run the tomcat server to test the application.

Jsp , struts 2 example in eclipse

 

 

Once we click submit button , the form data will update to the database
Jsp , struts 2 example in eclipse




Related Posts :
How to Connect to Oracle from Liferay portlet ( Java Liferay and Oracle integration )
How to call C# .Net WCF web service in java SOAP client ( Visual Studio 2013 )
How to call PHP RESTful web service in java client
How to call java SOAP web service in php ( php web service client )
Solution to SSLHandshakeException (skip the certificate for Java and LDAP bind)
Java RESTful web service example in maven using JAX-RS
RESTful web service example in java using JAX-RS
Create a java web service from WSDL (Top down approach) in Eclipse
   [will not be published]



^ <