carré
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user