Nov 2, 2017

DB connection code for your application:


DB Type
Connection code
String URL = "jdbc:mysql://mysql{node_id}-{environment_name}.{hoster_domain}/{dbname}";
DriverManager.getConnection(URL, user_name,user_password);
String URL =  "jdbc:mysql://mariadb{node_id}-{environment_name}.{hoster_domain}/{dbname}";
DriverManager.getConnection(URL, user_name,user_password);
String URL = "jdbc:postgresql://postgres{node_id}-{environment_name}.{hoster_domain}/{dbname}";
DriverManager.getConnection(URL, user_name,user_password);
Mongo m = new Mongo(mongodb{node_id}-{environment_name}.{hoster_domain});
DB db = m.getDB ({database_name});
if (db.authenticate(user_name,user_password.toCharArray())) {
System.out.println("Connected!");
}
String host = "couchdb{node_id}-{environment_name}.{hoster_domain}";
int port = 80;
String username = "username";
String password = "password";

Session dbSession = new Session(host, port, username, password);
For the UTF-8 encoding, modify your connection string according to this:
"jdbc:{dbtype}://{dbtype}{node_id}-{environment_name}.{hoster_domain}/{dbname}?useUnicode=yes&characterEncoding=UTF-8"