Compare commits

...

2 Commits

Author SHA1 Message Date
B00M360
5660a6c5c6 Merge branch 'main' of https://titi.koxi.nl/blodat/projet-dev 2026-03-28 14:38:28 +01:00
B00M360
607ee1fff4 carré 2026-03-28 14:37:13 +01:00
2 changed files with 4 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ public class GestionnaireNiveau {
public GestionnaireNiveau() { public GestionnaireNiveau() {
try { try {
//chargement driver
Class.forName("org.sqlite.JDBC"); Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
System.err.println("[BDD] Impossible de charger le driver SQLite."); System.err.println("[BDD] Impossible de charger le driver SQLite.");
@@ -79,6 +80,7 @@ public class GestionnaireNiveau {
} }
return false; return false;
} }
//transition smooth entre les niveau
public Niveau getNiveauActuel() { public Niveau getNiveauActuel() {
return niveaux.get(indexNiveau); return niveaux.get(indexNiveau);

View File

@@ -8,6 +8,7 @@ public class GestionnaireScore {
public GestionnaireScore() { public GestionnaireScore() {
try { try {
//chargement driver SQLite
Class.forName("org.sqlite.JDBC"); Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
System.err.println("[BDD] Impossible de charger le driver SQLite."); System.err.println("[BDD] Impossible de charger le driver SQLite.");
@@ -25,6 +26,7 @@ public class GestionnaireScore {
try (Connection conn = DriverManager.getConnection(URL); try (Connection conn = DriverManager.getConnection(URL);
PreparedStatement pstmt = conn.prepareStatement(sql)) { PreparedStatement pstmt = conn.prepareStatement(sql)) {
//contre injection SQL
pstmt.setString(1, nom.trim()); pstmt.setString(1, nom.trim());
pstmt.setInt(2, points); pstmt.setInt(2, points);
pstmt.executeUpdate(); pstmt.executeUpdate();