Připojení k DB a prvotní naplnění
do třídy PanelTabulky
try {
connection =
DriverManager.getConnection("jdbc:sqlite:Pokus");
statement = connection.createStatement();
//stat.executeUpdate("drop table if exists person");
statement.executeUpdate("create table if not exists osoby(FirstName varchar(50),LastName varchar(50),Email varchar(50));");
// pocatecni ulozeni
data = observableArrayList(
new Person("Jacob", "Smith", "jacob.smith@example.com"),
new Person("Isabella", "Johnson", "isabella.johnson@example.com"),
new Person("Ethan", "Williams", "ethan.williams@example.com"),
new Person("Emma", "Jones", "emma.jones@example.com"),
new Person("Michael", "Brown", "michael.brown@example.com")
);
saveData();
Kurz 4IT115 cvičení
©Alena Buchalcevová