Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void connectionTest() {
- java.sql.Connection conn = null;
- try {
- final String mysqlConnUrl = "jdbc:postgresql://***.***.***.***:5432/databaseName";
- try {
- Class.forName("org.postgresql.Driver");
- Properties props = new Properties();
- props.setProperty("user", "root");
- props.setProperty("password", "root");
- props.setProperty("ssl", "true");
- conn = DriverManager.getConnection(mysqlConnUrl, props);
- } catch (NoClassDefFoundError i) {
- i.printStackTrace();
- }
- conn.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment