DriverManager

This class contains methods that load and initialize the Oracle JDBC driver. It also establishes a connection object for the various drivers. The methods available in this class are described in Table A.1.

Table A.1. Methods of the DriverManager Class
MethodPurpose
getConnectionEstablish a connection to an Oracle instance and return a connection object that is used for further communication with the database.
 The format of the URL used depends on the type of Oracle driver used to establish the connection. For the Oracle thin JDBC driver, the format is
 Jdbc:oracle:thin:@hostname:port_number:sid
 Where
 hostname is the name of the machine that is hosting the instance
 port_number isthe listener port number (for instance, 1521 or 1526)

Get e-Commerce Applications Using Oracle8i and Java from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.