Tuesday, September 16, 2014

Spring MVC + Hibernate

I found this CRUD example and got it to run locally on tomcat:

http://www.journaldev.com/3531/spring-mvc-hibernate-mysql-integration-crud-example-tutorial.

with local database of postgresql instead... I needed to put the postgresql jdbc jar onto tomcat's lib, and change that servlet-context file. Also need to update the CREATE TABLE statement as follows for postgres:

CREATE TABLE Person ( "id" serial, "name" varchar(20) NOT NULL, "country" varchar(20) DEFAULT NULL, PRIMARY KEY ("id") );

A running example is worth more than a thousand (if not a million) words.

Thanks to the gentleman who wrote that article. Thanks for writing that maven file. hard to crank that out from scratch. All that configuration files needed... thanks to spring.

No comments: