In some of the other replies to your question people used
DecimalFormat. That is ok as long as the rounding method that you
want is ROUND_HALF_EVEN. Peronally I would use java.math.BigDecimal
to do number rounding. That way you can choose any rounding method
that you want. ie....
double d = 1.12345;
BigDecimal bd = new BigDecimal(d).setScale(3, BigDecimal.ROUND_HALF_UP);
If you want the string value:
String s = bd.toString();
If you want the double value again:
d = bd.doubleValue();
As far as the SQL question is concerned I think if you just drop the
table and create again then the auto increment number will start at 1
again. You can also just "truncate" the table which in effect drops
and creates the table in 1 step.