C
C
click_f2016-11-05 18:31:00
Java
click_f, 2016-11-05 18:31:00

How is JDBC different from ORM?

How do they differ and in what cases should one or another approach be preferred?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2016-11-05
@click_f

JDBC interface for sql queries. You work with bare sql queries and operate on tables, rows, columns and values. If you need to put the results of the query with objects, then you yourself push them there.
ORM is an interface for mapping classes to tables, rows, columns and database values. You work with java objects, ORM forms sql queries for you. In other words, you don’t think (almost) how to write an sql query, extract data from it, and scatter the values ​​among your classes.
Of course, it is preferable to work with ORM, since everything will be optimized and cached for you. Of course, you will need to know not only how your database works, but also how your ORM works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question