package com.example.happy_bird;

import java.beans.Statement;
import java.sql.*;
public class MariaDB
{
    public String username;
    public String pw;
    public String url;
    public String driver;
    Connection con;
    Statement st;

    public MariaDB()
    {

        username="root";
        pw="HappyBird1";
        url="jdbc:mariadb://localhost:3306/happybird";
        driver="org.mariadb.jdbc.Driver";
        try {
            Class.forName(driver);
            con=DriverManager.getConnection(url, username, pw);
            System.out.println("Connection is successful");
        } catch (Exception e) {
            System.out.println("Fehler in der Verbindung");
            e.printStackTrace();
        }


/*
        try
        {
            con = DriverManager.getConnection("jdbc:mariadb://localhost:3306/happybird?user=root&password=HappyBird1");
            st= (Statement) con.createStatement();
            driver="org.mariadb.jdbc.Driver";
            System.out.println("Connection is successful");
        }
        catch (Exception e)
        {
            System.out.println("Fehler in der Verbindung");
            e.printStackTrace();
        }

 */
    }
}
