JDBC VS Hibernate [closed]

Answering issues listed above:

1. Hibernate cannot connect with an “Existing” database. It always try to create a one of its own.

This is wrong. Hibernate can connect to an existing database, and it doesn’t always try to recreate it. You just should turn of parameter like hbm2ddl. auto.

2. Our database might access by same application which is in different platforms (cloud, server, VPS, Personal Computer). Hibernate can make problems because of its caching in this situation.

Hibernate has an adjustable cache, so this is also not a problem.

3. We never like to give the “table creating work” to the java code. We create tables manually, always.

No problem. See p.1 above. Furthemore there are several convinient libraries for indirect table creation and update (e.g. liquibase) which can be used in couple with hibernate perfectly.

4. We might have to use very long and complex SQL statements. Last time we used an statement with more than 150 lines, joining more than 20 tables. We doubt whether we will face troubles in this when it comes to Hibernate.

You can always use direct JDBC calls and invoke native SQL queries via hibernate, if it is neeeded.

5. Our SQL code is nice and standard. Hibernate generated code seems to be bit dirty for us.

Again, if you have to invoke some logic complicated SQL code instead of hibernate auto-generated – you can do it.

6. We always use MySQL. Never use any other DB.

Not a problem at all. Hibernate has special MySQL dialect support: org.hibernate.dialect.MySQLDialect.

7. The application we create require max security, related to medical. If at least one data record is leaked, we are done.

Security issues aren’t related to ORM techniques. Hibernate is just logical and convinient object-oriented layer between pure database JDBC calls and programmers tools. It doesn’t influence somehow on common net security.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)