Advertisement
Guest User

Untitled

a guest
Dec 5th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package restoran;
  7.  
  8. /**
  9. *
  10. * @author The Best+O
  11. */
  12. import java.sql.Connection;
  13. import java.sql.DriverManager;
  14. import javax.swing.JOptionPane;
  15.  
  16.  
  17. public class koneksi {
  18. Connection koneksi=null;
  19. public static Connection koneksiDb(){
  20. try{
  21. Class.forName("com.mysql.jdbc.Driver");
  22. Connection koneksi = DriverManager.getConnection("jdbc:mysql://localhost/db_restoran","root","");
  23. return koneksi;
  24. }catch(Exception e){
  25. JOptionPane.showMessageDialog(null, e);
  26. return null;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement