Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package blogarif.com;
- import com.mysql.jdbc.Connection;
- import java.sql.DriverManager;
- * @author blogarif.com */
- public Koneksi(){
- try {
- String host,user,pass;
- host="jdbc:mysql://localhost:3306/dbblogarif";
- user="root"; pass="root";
- // lakukan koneksi konek=(Connection)DriverManager.getConnection(host, user, pass);
- System.out.println("BERHASIL TERKONEKSI KE DATABASES");
- }
- catch (SQLException ex)
- {
- // jika koneksi Gagal
- System.out.println("GAGAL TERKONEKSI KE DATABASES");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement