Advertisement
prasatu

BasisData.java

Sep 16th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1.  
  2. import java.sql.*;
  3. import javax.swing.JOptionPane;
  4.  
  5. /**
  6. *
  7. * @author AgungPramono
  8. */
  9. public class BasisData {
  10.  
  11. public static void main(String[] args) {
  12. try {
  13. Class.forName("com.mysql.jdbc.Driver");
  14. } catch (Exception e) {
  15. System.out.println(e);
  16. }
  17. //Membangun koneksi ke database
  18. try {
  19. Connection konek = DriverManager.getConnection("jdbc:mysql://localhost:3306/infonegara", "root", "");
  20. System.out.println("sukses");
  21. } catch (Exception e) {
  22. System.out.println(e);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement