Erste Klasse Datenbankeinbindung
This commit is contained in:
parent
9c028dd79e
commit
5e57dfa022
20
Happy_Bird/src/main/java/MariaDB.java
Normal file
20
Happy_Bird/src/main/java/MariaDB.java
Normal file
@ -0,0 +1,20 @@
|
||||
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()
|
||||
{
|
||||
try {
|
||||
con = DriverManager.getConnection("jdbc:mariadb://localhost:3306/DB?user=root&password=HappyBird1");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ module com.example.happy_bird {
|
||||
requires javafx.controls;
|
||||
requires javafx.fxml;
|
||||
requires java.desktop;
|
||||
requires java.sql;
|
||||
|
||||
|
||||
opens com.example.happy_bird to javafx.fxml;
|
||||
|
Loading…
Reference in New Issue
Block a user