How do I get a database connection to a Oracle database?

This example shows you how to get a database connection to a Oracle database.
package net.javaiq.examples.database;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * This class demonstrates on how to get a database connection to a Oracle database.  
 * @author JavaIQ.net
 * Creation Date Dec 10, 2010
 */
class OracleDatabaseConnector {
    public OracleDatabaseConnector() {
    }

    public static Connection getConnectionForOracleDatabase() {
        String hostName = "oradbsvr"; //The host where the database is installed
        String portNum = "1528"; // The port on the which the database is listening
        String dbName = "Sample"; // The name of the database
        //String url = "jdbc:oracle:thin:@10.255.169.55:1528:ATSPROD";
        String url = "jdbc:oracle:thin:@" + hostName + ":" + portNum + ":" + dbName;
        System.out.println("db URL : " + url);
        String driver = 
            "oracle.jdbc.driver.OracleDriver"; // The driver class (classes12.jar) should be in the classpath
        String userName = "Test";
        String password = "test@123";
        Connection con = null;
        try {
            Class.forName(driver);
            con = DriverManager.getConnection(url, userName, password);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return con;
    }

    /**
     * Method to test the methods in the class with sample inputs
     * @param args
     */
    public static void main(String[] args) {
        getConnectionForOracleDatabase();
    }
}