Matthew F. answered 04/05/19
Professional Software/ Web Developer Specializing in Java
If you proceed as you've been doing you will go insane. I suggest a switch to PreparedStatement with JDBC post haste. Essentially it's used like this.
Can also be used for selections, values returned to ResultSet instead of integer
.executeQuery() used for selects, .executeUpdate() used for inserts.
Further reading:
http://www.ntu.edu.sg/home/ehchua/programming/java/jdbc_basic.html