Note that there are some explanatory texts on larger screens.

plurals
  1. PO java.sql.SQLException: Invalid cursor state in my jsp page
    primarykey
    data
    text
    <p>i wish to create a table in which the first 3 columns are plain text but the 4th column is a column of text areas and the last column is a column of drop down lists. all the input given in these form elements is to be sent to a separate jsp page where iit will be updated in the database. here is the code i wrote </p> <pre><code> &lt;form name="input" action="UpdateSMCFO.jsp" method="post"&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt;Dist. Code&lt;/th&gt; &lt;th&gt;Cons. No.&lt;/th&gt; &lt;th&gt;Consumer Details&lt;/th&gt; &lt;th&gt;Verification by FO&lt;/th&gt; &lt;th&gt;Remarks by SO&lt;/th&gt; &lt;/tr&gt; &lt;% int r=0; while (rs.next()) {r++; } for(int j=0;j&lt;r;j++) { out.println("&lt;TR&gt;"); for (int i = 0; i &lt; columnCount; i++) { if(i&gt;=0 &amp;&amp; i&lt;=2) { out.println("&lt;TD&gt;"+rs.getString(i+1)+"&lt;/TD&gt;"); } else if(i==3) { out.println("&lt;TD&gt;&lt;input type=\"text\" name=\"FOVerification\""+String.valueOf(j)+"/&gt;&lt;/TD&gt;"); } else { out.println("&lt;TD&gt;&lt;select name=\"SORemarks\""+String.valueOf(j)+"&gt;"); out.println("&lt;option value=\"Please Specify\"&gt;Please Specify&lt;/option&gt;"); out.println("&lt;option value=\"Genuine Customer\"&gt;Genuine Customer&lt;/option&gt;"); out.println("&lt;option value=\"MC\"&gt;MC-To be blocked&lt;/option&gt;"); out.println("&lt;/select&gt;&lt;/TD&gt;"); } } out.println("&lt;/TR&gt;"); } %&gt; &lt;/table&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt; </code></pre> <p>i am very sure this is not the way to handle the table elements but this is all i could come up with. please give me any ideas in the scope of jsp and html only. now, i only started learning jsp a week ago so i am very new to the concepts. </p> <p>this is the stack trace:</p> <p>type Exception report</p> <p>message</p> <p>descriptionThe server encountered an internal error () that prevented it from fulfilling this request.</p> <p>exception</p> <p>javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload