Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- import javax.swing.*;
- public class DBConnect {
- Connection con;
- public static Connection DB() {
- try {
- Class.forName("com.mysql.cj.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/quizgame", "root" ,"");
- return con;
- }catch(Exception e) {
- JOptionPane.showMessageDialog(null,e);
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement