daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Nov 6th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected void connectionTest() {
  2.         java.sql.Connection conn = null;
  3.         try {
  4.             final String mysqlConnUrl = "jdbc:postgresql://***.***.***.***:5432/databaseName";
  5.             try {
  6.  
  7.                 Class.forName("org.postgresql.Driver");
  8.                 Properties props = new Properties();
  9.                 props.setProperty("user", "root");
  10.                 props.setProperty("password", "root");
  11.                 props.setProperty("ssl", "true");
  12.                 conn = DriverManager.getConnection(mysqlConnUrl, props);
  13.  
  14.             } catch (NoClassDefFoundError i) {
  15.                 i.printStackTrace();
  16.             }
  17.             conn.close();
  18.         } catch (Exception ex) {
  19.             ex.printStackTrace();
  20.         }
  21.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top