PrepareStatement DELETE incorrecte
Bonjour,
Souhaitant réaliser des DELETE sur ma base embarquée j'ai donc, réalisé ce code, pour sélectionner ce que je veux supprimer :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
public static void deleteLivre() throws SQLException
{
try
{
PreparedStatement preparedStatement = connection
.prepareStatement("DELETE FROM LIVRES WHERE titre= ?");
preparedStatement.setString( 2 , Livre.getTitre());
preparedStatement.executeUpdate(); |
Code:
1 2 3 4 5
| Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at org.sqlite.PrepStmt.batch(PrepStmt.java:272)
at org.sqlite.PrepStmt.setString(PrepStmt.java:479)
at database_livre.Connexion.suppressionLivre(Connexion.java:315)
at database_livre.Livre.saisiePoursuppressionLivre(Livre.java:87) |
Je fais une erreur mais je ne saisi pas ou ? Surtout que l'exception :java.lang.ArrayIndexOutOfBoundsException: 1, m'indique l'indexe 1 or tous mes titres de livres sont dans la colonne 2.
par avance merci