Advertisement
Guest User

Untitled

a guest
Jan 9th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 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(){ try { String host,user,pass;
  6.  host="jdbc:mysql://localhost:3306/dbblogarif";
  7.  user="root"; pass="root";
  8. // lakukan koneksi konek=(Connection)DriverManager.getConnection(host, user, pass);
  9. System.out.println("BERHASIL TERKONEKSI KE DATABASES");
  10.  }
  11. catch (SQLException ex)
  12. {
  13. // jika koneksi Gagal
  14. System.out.println("GAGAL TERKONEKSI KE DATABASES");
  15.  }
  16.  }
  17.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement