Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.  
  2. import java.sql.Connection;
  3. import java.sql.DriverManager;
  4. import java.sql.Statement;
  5. import javax.swing.JOptionPane;
  6.  
  7. public class koneksi {
  8.     Connection con;
  9.     Statement stm;
  10.    
  11.     public void config(){
  12.         try {
  13.             Class.forName("com.mysql.jdbc.Driver");
  14.             con=DriverManager.getConnection("jdbc:mysql://localhost/tugasjava", "root", "");
  15.             stm = con.createStatement();
  16.         } catch (Exception e) {
  17.             JOptionPane.showMessageDialog(null, "koneksi gagal "+e.getMessage());
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement