Increment e009 to e010 using java
<p>I have a table with fields like empNo, Name , etc.
and i want java to generate numbers automatically.
for eg. if the number of the last employee was e009,
java should give me the number for the next one as e010.</p>

<p>I tried this and it works well but seems tedious.</p>

<pre><code>     rs.last();
     String no,temp;
     no = rs.getString(1);      
     int len = no.length();
     len=len-1;
     int n = Integer.parseInt(no.substring(1,no.length()));
     n=n+1;
     int length = (int)(Math.log10(n)+1);
     no="E";
     for(int i=1;i&lt;=len-length;i++)
        no=no+"0";
     no=no+n;
     txtNo.setText(no);
</code></pre>