 <p>When</p> <pre class="lang-java prettyprint-override"><code>String sql = "update StudentDatabaseS set RollNo = ?, FullName = ?, FatherName = ?, FatherCNIC = ?, DateOfBirth = ?, Class = ?, Address = ?, City = ?, Province = ? where RollNo = '"+Srollno+"'"; </code></pre> <p>the line</p> <pre class="lang-java prettyprint-override"><code>ResultSet rs = st.executeQuery(sql); </code></pre> <p>makes no sense because </p> <ol> <li>that query does not return a ResultSet, and</li> <li><code>executeQuery</code> has no way of knowing what values correspond to the parameter placeholders (<code>?</code>).</li> </ol> <p>If you omit that line then the "parameter marker not allowed" error will go away and you can carry on with your UPDATE using the PreparedStatement.</p>