Compare commits
2 Commits
f295a34ca5
...
5660a6c5c6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5660a6c5c6 | ||
|
|
607ee1fff4 |
@@ -20,6 +20,7 @@ public class GestionnaireNiveau {
|
||||
|
||||
public GestionnaireNiveau() {
|
||||
try {
|
||||
//chargement driver
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
} catch (ClassNotFoundException e) {
|
||||
System.err.println("[BDD] Impossible de charger le driver SQLite.");
|
||||
@@ -79,6 +80,7 @@ public class GestionnaireNiveau {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//transition smooth entre les niveau
|
||||
|
||||
public Niveau getNiveauActuel() {
|
||||
return niveaux.get(indexNiveau);
|
||||
|
||||
@@ -8,6 +8,7 @@ public class GestionnaireScore {
|
||||
|
||||
public GestionnaireScore() {
|
||||
try {
|
||||
//chargement driver SQLite
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
} catch (ClassNotFoundException e) {
|
||||
System.err.println("[BDD] Impossible de charger le driver SQLite.");
|
||||
@@ -25,6 +26,7 @@ public class GestionnaireScore {
|
||||
try (Connection conn = DriverManager.getConnection(URL);
|
||||
PreparedStatement pstmt = conn.prepareStatement(sql)) {
|
||||
|
||||
//contre injection SQL
|
||||
pstmt.setString(1, nom.trim());
|
||||
pstmt.setInt(2, points);
|
||||
pstmt.executeUpdate();
|
||||
|
||||
Reference in New Issue
Block a user