Describe how to open a database connection using JDBC. Opening a database connection:
The database connection should be established after registering the drivers. The getConnection is used to open a database connection. The following code snippet illustrates this:
con = DriverManager.getConnection(url,"scott","tiger");// returns the connection object where url specifies the database server port, ip address,domain name etc.
The ip address is an imaginary one and not intended to specify any specific system. The “scott” and “tiger” are the user name and passwords respectively.