r/SpringBoot • • Aug 14 '23

Progress for the day. Learned the difference between using JDBC and Spring Data JPA. I am addicted to learning.

Post image
40 Upvotes

21 comments sorted by

2

u/[deleted] Aug 14 '23

What’s the difference e

9

u/OldCriticism5226 Aug 14 '23

JDBC requires writing lots of sql queries, and also creating connections to the database, so lots of java coding. Spring JDBC simplifies the java coding part like connecting to the db, adds one layer of abstraction. JPA uses java objects to interact with the db, providing higher level of abstraction and no need for sql queries. SpringData JPA provides even higher abstraction, great for CRUD operations, and no sql queries unless writing custom queries where u can use @Query in the repository interface that extends JpaRepository. The lower level you the finer control you have over the queries. So you gotta pick and choose based on needs or preferences.

1

u/[deleted] Aug 14 '23

Jdbc uses sql query to reach data base and spring data jpa uses repository that extends to jpaRepository?

5

u/PandaCamper Aug 14 '23

I might be wrong here, but I think JPA uses JDBC under the hood too, it's just a layer on top to make DB access and quarries accessible via the repositories and POJOs.

2

u/[deleted] Aug 14 '23

From where are you learning , following a course or what?

I also want to learn spring/springboot, can you suggest me a good resource , or a course?

4

u/OldCriticism5226 Aug 14 '23

Master spring framework on udemy by 28minutes, and make sure to know java and object oriented programming, have fun with it.

1

u/[deleted] Aug 14 '23

If it's ok to ask you , can you tell from where you learned Java and object oriented programming also?

2

u/manu_moreno Aug 15 '23

You can follow and watch the Spring Boot content posted by Dan Vega on YouTube. He's got many tutorials. Dan works for VMware, owner of the Spring framework/technologies. Dan is very knowledgeable and a good communicator. There is also content published by Java Techie, AmigosCode, etc. Enjoy!

1

u/[deleted] Aug 16 '23

Thanks so much

4

u/DrewTheVillan Aug 14 '23

Trust me. It gets better the more you learn. You’ll be thinking differently. Spring/Springboot makes it hard to use anything else

1

u/Dramatic-Iron8645 Aug 14 '23

Yes, it's such a great framework

3

u/RunningVic Aug 14 '23

congrats! keep going, you will be king!

1

u/Legal_Being_5517 Aug 17 '23

Surprisingly most companies still use JDBC

1

u/karthgamer1209 Aug 20 '23

practice makes perfect :)

1

u/teodorfon Nov 15 '23

Gradianto ;-D