D
D
dissdoc2015-06-19 16:07:22
MySQL
dissdoc, 2015-06-19 16:07:22

Which is better Stored Procedures or use JDBC Java?

Hello!
There was a question. Now I am at a crossroads. What to choose:
1. Use SQL queries in a Java program
2. Use Stored Procedures, and already query the results of their work in Java
I always followed the rule, if the database can do it, then let it do it. But now I began to doubt. Is it worth storing procedures? What are the pros and cons you see in each approach?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2015-06-19
@dissdoc

(1) Flexibility + testability
vs.
(2) speed + binding to the engine + hassle with migrations + logic in the database
However, I'm not sure that muscle procedures are now production ready

R
Rodgenk, 2015-06-19
@Rodgenk

You should not store business logic, without special need in the database. Because maintaining and refactoring a database is an order of magnitude more difficult than java code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question