O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spring JDBC example

In this example, we are using the PostgreSQL database. The table schema is as follows:

CREATE TABLE account(  accountNumber numeric(10,0) NOT NULL,   accountName character varying(60) NOT NULL,  CONSTRAINT accountNumber_key PRIMARY KEY (accountNumber))WITH (  OIDS=FALSE);

We will use the DAO pattern for JDBC operations, so let's create a Java bean that will model our Account table:

package com.packt.springhighperformance.ch5.bankingapp.model;public class Account {  private String accountName;  private Integer accountNumber;  public String getAccountName() {    return accountName;  }  public void setAccountName(String accountName) {    this.accountName = accountName;  }  public Integer getAccountNumber() {    return accountNumber;  } public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required