Advertisement
sergAccount

Untitled

Feb 6th, 2021
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.app10;
  7.  
  8. import java.sql.Connection;
  9. import java.sql.DriverManager;
  10. import java.sql.SQLException;
  11.  
  12. public class DBTest {
  13.     //
  14.     public static void main(String[] args) {
  15.        
  16.         try {
  17.             //Connection c = null;
  18.             Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres", "postgres", "postgres");
  19.             System.out.println("conn=" + conn);
  20.         } catch (SQLException ex) {
  21.             ex.printStackTrace();
  22.         }
  23.     }    
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement