Advertisement
Guest User

Untitled

a guest
Jan 9th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package blogarif.com;
  2. import com.mysql.jdbc.Connection;
  3. import java.sql.DriverManager;
  4. * @author blogarif.com */
  5. public Koneksi(){
  6.     try {
  7.         String host,user,pass;
  8.         host="jdbc:mysql://localhost:3306/dbblogarif";
  9.         user="root"; pass="root";
  10. // lakukan koneksi konek=(Connection)DriverManager.getConnection(host, user, pass);
  11.         System.out.println("BERHASIL TERKONEKSI KE DATABASES");
  12.         }
  13.         catch (SQLException ex)
  14.         {
  15. // jika koneksi Gagal
  16.         System.out.println("GAGAL TERKONEKSI KE DATABASES");
  17.         }
  18.     }
  19.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement