Horrible formatting. When using the parameters you do not set '?', but simply ?.
Change the line:
PreparedStatement pstmt = conexion.prepareStatement("INSERT INTO general_news(id,title,link,author,description,date,content) VALUES ('?','?','?','?','?','?')");
to
PreparedStatement pstmt = conexion.prepareStatement("INSERT INTO general_news(id,title,link,author,description,date,content) VALUES (?,?,?,?,?,?)");
That's why he thinks you have 0 parameters, but pointed out the first one.
Also note what you are executing INSERTand as such SHOULD NOT use executeQuery. Use executeUpdate () instead .
source
share