Guest User

Untitled

a guest
Jan 14th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public Database() {
  2. try {
  3. Class.forName("org.postgresql.Driver");
  4. } catch (ClassNotFoundException cnfe) {
  5. System.out.println("" + cnfe);
  6. }
  7. try {
  8. Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/tomcat", "root", "root");
  9. statement = (Statement) connection.createStatement();
  10. } catch (SQLException ex) {
  11. Logger.getLogger(create.class.getName()).log(Level.SEVERE, null, ex);
  12. }
  13.  
  14. }
Add Comment
Please, Sign In to add comment