I have a Spring Boot REST application that's connected to an Oracle database. We're using JDBC using JdbcTemplate. The Oracle database properties are obtained through these 3 application.properties settings:
spring.datasource.url
spring.datasource.username
spring.datasource.password
This application is using the HikariCP. From the HikariCP website, I came to know that this pool doesn't cache PreparedStatements because the JDBC driver is best setup to do that.
Now, where and what would I specify to ensure these :
That the Oracle JDBC Driver(ojdbc7.jar) caches PreparedStatements. Is there a way to customize the number of PreparedStatements that it can cache.
From https://howtodoinjava.com/java/jdbc/best-practices-to-improve-jdbc-performance/, we see that
Ensure that your database is set to the maximum packet size and that the driver matches that packet size. For fetching larger result sets, this reduces the number of total packets sent/received between the driver and server.
In pursuance of the above, what are the steps required to
- find the Oracle DB Server packet size
- find if the Oracle DB Server is set to the maximum packet size
- find set the Oracle JDBC driver's(ojdbc8.jar) packet size.
Any other (Oracle) JDBC performance optimization tip would be appreciated.