kelas koneksi

package Connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class koneksi {
public Connection con;
public Statement st;

public koneksi() {
}

public void cekKoneksi(){
try{
Class.forName(“com.mysql.jdbc.Driver”);
System.out.println(“Driver ?Ok …..”);
}catch(Exception e) {
System.out.println(“Driver error : ” +e);
}
try{
con = DriverManager.getConnection(“jdbc:mysql://localhost:3306/databasemu”,”user”,”password”);
st = con.createStatement();
System.out.println(“Konek Ok …..”);
}catch(Exception e){
System.out.println(“Koneksi Error : “+e);
}
}
}

~ oleh fensliq pada 25 Februari, 2008.

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: