int selectie = toernooienUitvoer.getSelectedRow(); int selectiec = toernooienUitvoer.getSelectedColumn(); String primarykey = (String) toernooienUitvoer.getValueAt(selectie, 0).toString(); String waarde = toernooienUitvoer.getValueAt(selectie, selectiec).toString(); String columnaam = toernooienUitvoer.getModel().getColumnName(selectiec).toString(); String input = JOptionPane.showInputDialog("wijzig geselecteerde data", waarde); toernooienUitvoer.setValueAt(input, selectie, selectiec); PreparedStatement stat = con.prepareStatement("UPDATE fullhouse.toernooi SET ? = ? WHERE toernooi.T_code = ?"); stat.setString(1, columnaam); stat.setString(2, input); stat.setString(3, primarykey); Guys, i know the query is correct, if i input the values. my guess my mistake is somewhere in the preparedstatement i am getting a MySQLSyntaxErrorException: