Advertisement
Guest User

tita-connect

a guest
Nov 12th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. package connection;
  2.  
  3. import com.mysql.jdbc.Connection;
  4. import java.sql.DriverManager;
  5. import javax.swing.JOptionPane;
  6.  
  7.  
  8. /**
  9.  *
  10.  * @author aldycavalera
  11.  */
  12. public class connect {
  13.     static Connection Connect;
  14.     public static Connection getConnection()
  15.     {
  16.         try {
  17.             Connect = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/toko_botay", "root", "");
  18.         } catch(Exception e) {
  19.             JOptionPane.showMessageDialog(null,"koneksi database gagal!");
  20.         }
  21.         return null;
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement