10 Best Practices
1. Use Database Service on Cloud:
Use the Oracle Database Service on Cloud (DBCS) to create a database on cloud. DBCS comes with an in-built HR schema and tables that you can use when you build the HR web application.
2. JDBC Driver, UCP:
Note:
Download the latest JDBC drivers and UCP from the JDBC and UCP Downloads page3. JDK Version
Use a JDK version that is compatible with Oracle Database Release 23ai. Refer to Version Compatibility for Oracle JDBC Drivers for more details.
4. Auto-Closeable Statements
Starting JDK7, ‘Auto-closeable statements’ has been introduced, that close by default without an explicit catch
statement.
5. Use PreparedStatement instead of Statement objects:
Statement in JDBC must be localized to being used for DDL
(ALTER, CREATE, GRANT
etc) since these commands cannot accept bind variables.
Use PreparedStatement
or CallableStatement
for any other type of statement. These statements can accept bind variables.