title: automatic bill number generation in jsp
body: <p>In my project I need to generate bill number automatically.</p>
  
  <p>My database is mysql.</p>
  
  <p>I am getting the default value 0 from the column 'bill_no' and increment that value. It's working fine, but my problem is it is incremented up to 10. After that it is not incremented. </p>
  
  <p>What is the reason? please let me know,thanks</p>
  
  <p>My code is:</p>
  
  <pre><code> &lt;%
      connection=DBCreation.getConnection();
        Statement statement=connection.createStatement();
       resultSet= statement.executeQuery("select max(diag_pt_bill_no_v) from diagnostics_details");
       if(resultSet.next())
  
       {
           System.out.println(resultSet.getInt(1));
          i=resultSet.getInt(1)+1;
       }}catch(Exception e){
            e.printStackTrace();
      %&gt;
      &lt;form action="diagnosticsinsert" method="post" name="form"&gt;
      &lt;table&gt;&lt;tr&gt;
       &lt;td&gt;&lt;label class="red"&gt;Bill No&amp;nbsp;&amp;nbsp;&lt;/label&gt;&lt;input type=text name="bno"  placeholder="Bill No" size="17px" value="&lt;%=i++%&gt;"
      &lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
   &lt;td&gt;&lt;button name="save"  id="save" style="width: 80px; height: 30px;font-size: 15px;" value="Save" accesskey="S" onclick="getTotalTests()"&gt;Save&lt;/button&gt;(Alt+s)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
  
      &lt;/form&gt;
  </code></pre>