Improving performance sharing reusable code
In this recipe, we will see how to share reusable code in our application to improve performance.
Getting ready
To demonstrate the performance gain by sharing reusable code, the following example is written in Java, similar to the one presented in the previous recipe.
How to do it...
The following steps will demonstrate how to share reusable code:
Create a
OraclePerformanceTuningCookbook
directory and achapter02
directory inside it.Open your preferred text editor.
Create a class called
SharedCode
in the packagechapter02
using the following code and save it in a file namedSharedCode.java
in the previously createdchapter02
directory:package chapter02; import java.sql.*; public class SharedCode { private static final String driver = "oracle.jdbc.driver.OracleDriver"; private static final String connectionString = "jdbc:oracle:thin:@localhost:1521:TESTDB"; private static final String user = "hr"; private static final String...