High-performance Java Persistence -

Use PreparedStatements to allow the database to cache execution plans. This reduces parsing overhead and protects against SQL injection.

Instead of sending 100 separate INSERT statements, use JDBC batching to send them in a single network round-trip. For Hibernate users, this requires setting hibernate.jdbc.batch_size . 2. Optimize JPA & Hibernate Mapping High-Performance Java Persistence

A common mistake is designing entity mappings based solely on the object model without considering the generated SQL. 14 High-Performance Java Persistence Tips - Vlad Mihalcea Use PreparedStatements to allow the database to cache