Connect ke Database Online

Klo connect ke localhost khan spt ini:
Class.forName(“com.mysql.jdbc.Driver”);
String url = “jdbc:mysql://localhost:3306/definisiremote”;
String user = “root”;
String pw = “”;
con = DriverManager.getConnection(url, user, pw);
Nah klo connect ke database online gmn yah??Cuz code di atas sy ganti “localhost” dgn IP public yg dikasih sm web hosting-nya msh ga jalan..

bisa2 aja pakai web address misal:

Code:
String url = "jdbc:mysql://www.goldenstudios.or.id/definisiremote";

pakai public IP harusnya jg bisa2 aja..

Code:
String url = "jdbc:mysql://[PUBLIC IP:PORT]/definisiremote";
Explore posts in the same categories: 1

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s


%d blogger menyukai ini: