Connecting using the JDBC Driver Manager
- Last Updated: March 11, 2022
- 1 minute read
- DataDirect Connectors
- JDBC
- MongoDB 6.1
- 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.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:mongodb://myserver:27017;AuthenticationDatabase=mydb2;
DatabaseName=mydb;user=jsmith;password=secret;");