Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package restoran;
- /**
- *
- * @author The Best+O
- */
- import java.sql.Connection;
- import java.sql.DriverManager;
- import javax.swing.JOptionPane;
- public class koneksi {
- Connection koneksi=null;
- public static Connection koneksiDb(){
- try{
- Class.forName("com.mysql.jdbc.Driver");
- Connection koneksi = DriverManager.getConnection("jdbc:mysql://localhost/db_restoran","root","");
- return koneksi;
- }catch(Exception e){
- JOptionPane.showMessageDialog(null, e);
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement