Connecting using the JDBC Driver Manager
- Last Updated: August 23, 2021
- 1 minute read
- DataDirect Connectors
- JDBC
- PostgreSQL 6.0
- Documentation
One way to connect to a service is through the JDBC DriverManager using the
DriverManager.getConnection() method. As the following
example shows, this method specifies a string containing a connection URL.
User ID/password authentication
Connection conn = DriverManager.getConnection
("jdbc:datadirect:postgresql://server1:5432;
User=test;Password=secret;");
Note: The User and Password properties are not required to be stored in the connection string.
They can also be passed separately by the application.