In my last post Setting up a Postgresql database , I showed how to install and setup a simple postgres local database. Now I am going to proceed and create a simple java Spring project that exposes a rest api endpoint allowing to query and fetch data from the database. The IDE i am using is Eclipse and I will be using Maven for building the project. To start create a Maven project using the archetype - maven-archetype-webapp. In Eclipse, I enable Dynamic Web Module Facet in the project's properties and set the compiler level to 1.7 at least. Update the pom.xml file to add required dependencies. For our project, we will use spring-webmvc , javax.servlet-api, jackson-core and jackson-databind. These are required to build a rest api endpoing with automatic conversion of java objects to json and vice versa. Also add following dependencies to enable persistence with the postgreSQL database - spring-data-jpa, hibernate-entitymanager, postgresql and jta....