package konek;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
/**
*
* @author ASUS
*/
public class koneksi {
private static Connection kon;
public static Connection dapatkan_koneksi(){
if(kon==null){
try{
DriverManager.registerDriver( new com.mysql.jdbc.Driver());
kon=DriverManager.getConnection("jdbc:mysql://localhost:3306/data_ilmukayu","root","" );
}catch(SQLException a){
JOptionPane.showMessageDialog(null, "hidupkan wampserver anda");
Logger.getLogger(koneksi.class.getName()).log(Level.SEVERE, null, a);
}
{
}
}
return kon;
}
}
No comments:
Post a Comment