Women in Technology

Hear us Roar

  Creating a Web Application with Ant and Tomcat 4
Subject:   Fix for id after deleting records
Date:   2006-02-07 04:26:54
From:   nav327

After deleting multiple entries the id field (auto_increment) does not reset creating non sequential id numbers.

Edit the public int deleteAddress method inside AddressesDB.java by inserting...

String alter_increment ="alter table addresses auto_increment=1";

and by adding inside the try block

Statement stmt= this.connection.createStatement();

**before realeasing the connection this.releaseConnection ();**

use ant to remove and install the application again.