You can use JDBC to create a connection to the database by implementing the method java.sql.DriverManager.getConnection.
Here, the following information is essential:
· Database name
· Name and password of the database user
· Name of the database computer, if you are connecting to a remote computer
In addition, you can define other connection options by specifying various properties.
Perform the following steps:
...
1. Define the connection URL. This URL contains the name of the database instance, and, if you are connecting to a remote computer, the name of this computer.
2. Specify any other connection options
3. Call the method java.sql.DriverManager.getConnection