Spring — Difference between JDBC and Spring JDBC | Code Factory

Spring Tutorial Index Page: Link

Difference between JDBC and Spring JDBC

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

Shopify for Frontend Engineers | #1 Dev Env, ThemeKit, Liquid

What is the difference between REM and EM on CSS3

AWS Transit Gateway Routing in Multiple Accounts

AWS — how to get started

Local Mode Training and Inference in SageMaker Studio

Lessons Learned While Building a Production Ready Dapp

Can We Trust GitHub Stars?

How I fell in love with flutter

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

Functional Interfaces in Java

Root of Number (Java solution)

Multithreading Concept in JAVA

Start with Spring Boot