Connect to Materialize @return a Connection object
()
| 15 | * @return a Connection object |
| 16 | */ |
| 17 | public Connection connect() { |
| 18 | Properties props = new Properties(); |
| 19 | props.setProperty("user", user); |
| 20 | props.setProperty("password", password); |
| 21 | props.setProperty("ssl","true"); |
| 22 | Connection conn = null; |
| 23 | try { |
| 24 | conn = DriverManager.getConnection(url, props); |
| 25 | System.out.println("Connected to Materialize successfully!"); |
| 26 | } catch (SQLException e) { |
| 27 | System.out.println(e.getMessage()); |
| 28 | } |
| 29 | |
| 30 | return conn; |
| 31 | } |
| 32 | |
| 33 | public static void main(String[] args) { |
| 34 | App app = new App(); |