There is such a construction
String query = "INSERT INTO database.postinfo (post_id) \n" + " VALUES ('id' );"; try { con = DriverManager.getConnection(url, user, password); stmt = con.createStatement(); stmt.executeUpdate(query); } catch (SQLException sqlEx) { sqlEx.printStackTrace(); } finally { //close connection and stmt heare try { con.close(); } catch (SQLException se) { /*can't do anything */ } try { stmt.close(); } catch (SQLException se) { /*can't do anything */ } } I want the values of the variables to be passed to VALUES. For example, I have a variable obtained using Jsoup, and I want to pass it to VALUES to populate the post_id column, but in my example above, only the text 'id' is transmitted (literally), not the value of the variable.
id = doc.select("div.story").attr("data-story-id")