added prenotazioni
This commit is contained in:
parent
ac8c58c4e5
commit
46f766644c
|
@ -1,4 +0,0 @@
|
|||
|
||||
public class Prenotazione {
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Prenotazioni extends Table{
|
||||
|
||||
public Prenotazioni(Connection connection, String statement) throws SQLException {
|
||||
super(connection, statement);
|
||||
}
|
||||
|
||||
public void insert(Attività attività, Data data) throws SQLException {
|
||||
var stmt = connection.prepareStatement("INSERT INTO prenotazioni (attività, data, disponibilità) VALUES (?, '2000-10-10', TRUE)");
|
||||
|
||||
//TODO: qui attivita è soltanto una stringa ma serve un enum
|
||||
stmt.setObject(1, attività, java.sql.Types.OTHER);
|
||||
|
||||
//TODO: setDate forse? stmt.setString(2, data.toString());
|
||||
|
||||
System.out.println(stmt);
|
||||
|
||||
stmt.executeUpdate();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue