0% found this document useful (0 votes)
135 views

Spring JDBC Template: JDBC Vs JPA, Flyway, CF Services

The document compares and contrasts JPA and JDBC, and also discusses Spring JDBC Template, Hikari datasource, Flyway database migration tool, and Cloud Foundry services. JPA works at the domain layer and provides object mapping while JDBC works at the data layer. Spring JDBC Template provides utility methods to simplify JDBC code and manages database connections. Flyway is an open source tool for database migrations that supports various RDBMS and uses SQL and Java migrations. Cloud Foundry services can be consumed on-demand from the marketplace.

Uploaded by

Aditya Bhuyan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views

Spring JDBC Template: JDBC Vs JPA, Flyway, CF Services

The document compares and contrasts JPA and JDBC, and also discusses Spring JDBC Template, Hikari datasource, Flyway database migration tool, and Cloud Foundry services. JPA works at the domain layer and provides object mapping while JDBC works at the data layer. Spring JDBC Template provides utility methods to simplify JDBC code and manages database connections. Flyway is an open source tool for database migrations that supports various RDBMS and uses SQL and Java migrations. Cloud Foundry services can be consumed on-demand from the marketplace.

Uploaded by

Aditya Bhuyan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Spring JDBC Template

JDBC vs JPA, Flyway, CF Services


JPA

1. Works at Domain Layer


2. ORM implementation
3. Abstracts complexities
4. Removes boilerplate code
5. Performance is good
6. DB agnostic
JDBC

1. Works at Data Layer


2. Driver implementation
3. Abstracts at lower level
4. Need to generate boilerplate code
5. Performance is good
6. DB Dependence
JDBC vs JPA

1. JPA programming need to be driven in a object model way


2. Data consumption is time consuming in JPA because adds more layers.
3. JPA is good when we may be frequently changing DB
4. Need to generate boilerplate code for JDBC
5. Performance is usually on slower side for JPA as it adds more layers of abstraction
6. Unit Test is easy with JDBC and little bit trickier with JPA
7. JPA adds more classes for each table into source control
JDBCTemplate

1. A wrapper over plain JDBC


2. Provides many utility methods which makes data access easier
3. Manages database connection [open/close]
4. Provides mapper for row to object
5. Provides methods for ResultSet, Staements
6. Converts standard exceptions to meaningful Runtime Exceptions
Hikari datasource

1. A very simple fast lightweight DB Connection pool


2. Provides high performance
Flyway
1. Opensource database migration tool
2. Supports Java API, CLI, Maven plugin , gradle plugin
3. Migrations are written in SQL and java
4. Based on 7 commands [migrate, undo, info, baseline, validate, clean, repair]
5. Supports almost all popular RDBMS and Cloud DBs like Amazon RDS, Google Cloud SQL, MS SQL
Auzure
6. Two types of migrations [versioned{regular,undo(pro version)}, repeatable]
7. Maintains schema history table for migrations
CF services

1. PCF Marketplace provides lot of services to be consumed in form of service catalog


2. On demand reserved resources can be procured
3. User Provided Service Instances could also be procured
4. Every service has credentials
5. Every service offers 1 or more procurement plans
6. Commands used cf [create-service | bind-service | delete-service| unbind-service]

You might also like