public void add(Compositeur compositeur) throws DaoException { PreparedStatement statement = null; try { statement = connection.prepareStatement( SQL_ADD ); statement.setString( 2, compositeur.getNom() ); statement.setString( 3, compositeur.getPrenom() ); statement.setInt( 4, compositeur.getAnneeNaissance() ); statement.setInt( 5, compositeur.getAnneeDece() ); statement.executeUpdate(); statement.close(); connection.commit(); } catch (SQLException e) { throw new DaoException( "Erreur SQL lors de l'insertion d'un enregistrement. " + e.getMessage() ); } } … private final static String SQL_ADD = "INSERT INTO T_COMPOSITEURS_COMP VALUES ( ?, ?, ?, ?, ? )";