Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: lolonda dotKlar
Added: Dec 15, 2020 10:23 AM
Views: 6
Tags: no tags
  1.     public Connection veriTabaninaBaglan() {
  2.         Connection baglanti = null;
  3.  
  4.         try {
  5.             Class.forName("org.postgresql.Driver").newInstance();
  6.             baglanti =DriverManager.getConnection("jdbc:postgresql://localhost:5432/otomasyon", "postgres", "1123");
  7.             System.out.println("veri tabanına bağlanılamadı... hata kodu:" + ex.getMessage());
  8.         }
  9.         return baglanti;
  10.     }