Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package DATABASE;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- /**
- *
- * @author birosandras
- */
- public class Database {
- private static final String URL = "jdbc:mysql://localhost:3306/login?autoReconnect=true&useSSL=false";
- private static final String USERNAME = "root";
- private String PASSWORD = "";
- public Database() {
- }
- public Connection getConnection(){
- Connection con = null;
- try {
- Class.forName("com.mysql.jdbc.Driver");
- con = DriverManager.getConnection(URL, USERNAME, PASSWORD);
- } catch (ClassNotFoundException|SQLException e1) {
- throw new RuntimeException(e1);
- }
- return con;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement