Simple Spring Hibernate App

Open Spring Tool Suite File -> New -> Spring Template Project Persistence -> Simple Spring Hibernate Utility Project Project Name: hibernateExample Top Level Package: com.skills421.examples.hibernate01 Finish Modifying the Code to Extend our Simple JDBC App File -> New -> Class Package: com.skills421.examples Name: Person Now Create a simple POJO called Person as follows: [sourcecode language=”Java”] package …

Simple Spring Hibernate App Read More »

Create a Simple JDBC App

Download and Install Spring Tool Suite http://www.springsource.org/sts Create a Maven Project Run Spring Tool Suite New -> Maven -> Maven Project Select the default quickstart archetype org.apache.maven.archetypes maven-archetype-quickstart Enter a Group Id and Artifact Id for the app: Group Id: com.skills421.jdbc Artifact Id: jdbcExample Edit Pom.xml [sourcecode language=”xml”] <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>com.skills421.jpa</groupId> …

Create a Simple JDBC App Read More »

Creating a Simple Postgres Database

Download and install Postgres Download Postgres from the Download Site For the Mac, download the Postgres App Edit the Path Variable On a Mac Open a Terminal Session Add the following line to your .profile export PATH=$PATH:/Applications/Postgres.app/Contents/MacOS/bin/ run your .profile . ./.profile Start the Postgres Database by clicking the Postgres app Create a Database psql …

Creating a Simple Postgres Database Read More »

Drools and the Maven pom.xml

I wanted to set up a simple Pom.xml file for Drools development and document where I found the dependencies. Commons Lang http://mvnrepository.com/artifact/commons-lang/commons-lang [sourcecode language=”xml”] <!– *** Commons Lang *** –> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>20030203.000129</version> </dependency> [/sourcecode] Finding the Drools Maven Repository http://search.maven.org/#browse%7C-1017984373 [sourcecode language=”xml”] <!– *** Drools Core *** –> <dependency> <groupId>org.drools</groupId> <artifactId>drools-compiler</artifactId> <version>5.5.0.Final</version> </dependency> …

Drools and the Maven pom.xml Read More »

Understanding Pom.xml

[sourcecode language=”xml”] <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>Maven Quick Start Archetype</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project> [/sourcecode] project This is the top-level element in all Maven pom.xml files. modelVersion This element indicates what version of the object model this POM is using. The version of the model …

Understanding Pom.xml Read More »

Installing Apache Maven

Download and install Java from here Download Apache Maven from here Follow the instructions to install Maven add the following lines to your .profile: [sourcecode language=”bash”] export M2_HOME=path to Maven export PATH=$PATH:$M2_HOME [/sourcecode] . ./.profile mvn –version Create a Sample Project from the Command Line CD to your Development Root folder mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false …

Installing Apache Maven Read More »