При выполнении запроса выдает Exception. Не может найти колонку "Нижний" , хотя в cityName приходит Нижний-Новгород
public static void setCityIdToOrderByName(String cityName, int orderId) throws SQLException {
preparedStatement = connection.prepareStatement("UPDATE orders SET city_id = (SELECT c.id FROM city c WHERE c.name = " + cityName + ") WHERE id = " + orderId);
preparedStatement.executeUpdate();
}
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such column: Нижний)
at org.sqlite.core.DB.newSQLException(DB.java:941)
at org.sqlite.core.DB.newSQLException(DB.java:953)
at org.sqlite.core.DB.throwex(DB.java:918)
at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
at org.sqlite.core.NativeDB.prepare(NativeDB.java:134)
at org.sqlite.core.DB.prepare(DB.java:257)
at org.sqlite.core.CorePreparedStatement.(CorePreparedStatement.java:47)
at org.sqlite.jdbc3.JDBC3PreparedStatement.(JDBC3PreparedStatement.java:30)
at org.sqlite.jdbc4.JDBC4PreparedStatement.(JDBC4PreparedStatement.java:19)
at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:35)
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:241)
at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:205)
at service.SQLhandler.setCityIdToOrderByName(SQLhandler.java:321)
at bot.BotState$2.handleInput(BotState.java:54)
at bot.Bot.onUpdateReceived(Bot.java:87)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
at org.telegram.telegrambots.meta.generics.LongPollingBot.onUpdatesReceived(LongPollingBot.java:27)
at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread.run(DefaultBotSession.java:305)