One way to connect to a database is by using the JDBC 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;DatabaseName=Test;
SchemaMap=MyUserProfile\\AppData\\Local\\Progress\\DataDirect\\MongoDB_Schema\\MyServer.config;
UserName=admin;Password=adminpass");