Advertisement
Guest User

Untitled

a guest
Apr 29th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 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 rfidtask;
  7. import com.mysql.jdbc.Connection;
  8. import com.mysql.jdbc.Driver;
  9. import java.sql.DriverManager;
  10. import java.sql.SQLException;
  11.  
  12. /**
  13. *
  14. * @author NadyaZ
  15. */
  16. public class koneksi {
  17. private static Connection koneksi;
  18. public static Connection GetConnection() throws SQLException {
  19. if (koneksi == null) {
  20. Driver driver = new Driver() {};
  21. koneksi = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/absensi", "root", "");
  22. }
  23. return koneksi;
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement