Spring — Difference between JDBC and Spring JDBC | Code Factory

Spring Tutorial Index Page: Link

Difference between JDBC and Spring JDBC


  • All the exceptions are compiletime exception (CE)
  • CE is java.sql.SQLException (It will print database exceptions).
  • User must need to close connection.
  • Jdbc PreparedStatement is type safe.
  • For select operation always it will return ResultSet.

Spring JDBC

  • All the exceptions are runtime exception (RE).
  • RE is DataAccessException (It will print database exceptions). It is in spring-dao.jar file.
  • User no need to close connection.
  • All JdbcTemplate methods are type safe using Types class.
  • Generic select methods for all type of select operations.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Develop Your Own x86 Operating System(OS) #7

Program a Networked Tic-Tac-Toe Game in Python

Linking GitHub to our Local Project

Lessons Learned While Building a Production Ready Dapp

Creating ER diagram for a MySQL database

Lighthouse Graphql File Upload

Changing the Color of Selection with CSS

Only 1 in 5 people can name one of their senators, are you one? Click to find out!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Code Factory

Code Factory

More from Medium

GoF Design Patterns in Java- Creational

Let’s talk about head first Java

Return nothing, with Java Optionals

Inversion of Control (IoC)