About the Driver
:
Using the Driver
:
Establishing a Connection
:
Connecting Using the JDBC Driver Manager
Connecting Using the JDBC Driver Manager
One way to connect to a database is through the JDBC Driver Manager using the DriverManager.getConnection() method. This method specifies a string containing a connection URL. This example shows how to establish a connection to a data source:
Connection conn = DriverManager.getConnection
("jdbc:datadirect:sparksql://Server3:10000;
DatabaseName=MyDB;User=admin;Password=secret");
In this section:
Registering the Driver with the Driver Manager
Passing the Connection URL with the Driver Manager
Testing the Driver Manager Connection