Bonjour, j'ai un probleme avec un insert : le code suivant me genere toujours un id egal à null alors que je lui fourni une valeur (comme aux autres champs d'ailleurs)
Quelqu'un saurait il pourquoi un insert serait susceptible de generer un null dans ma table ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
private static final String TABLE = "T_CATEGORY";
private static final String COLUMNS = "ID, NAME, DESCRIPTION";
public void insert(final PersistentObject object) throws DuplicateKeyException {
        Connection connection = null;
        Statement statement = null;
        final Category category = (Category) object;
 
        try {
            connection = getConnection();
            statement = connection.createStatement();
            final String sql = "INSERT INTO " + TABLE + "(" + COLUMNS + ") VALUES ('" + category.getId() + "', '" + category.getName() + "','" + category.getDescription()+"' )";
            statement.executeUpdate(sql);
            //...