public int isInfod(Vacancy vacancy, String table, String collumn) { try (PreparedStatement statement = conn.prepareStatement("SELECT ID FROM ? WHERE ? = ?")) { statement.setString(1, table); statement.setString(2, collumn); statement.setString(3, vacancy.getAuthor()); statement.executeQuery(); } catch (SQLException e) { e.printStackTrace(); } return 0; such a request produces errors, i.e. Do I get to write a separate query for each table and column? I have essentially the same request,
Vacancy. Do you have a field in each table where theAuthoris stored? - Alexander Petrov