hi,
i want to delete the first record in sms table.the program works but the record is not getting deleted in the table when i call listrecord().I had set the
autocommit mode to false.kindly help me regarding this.code is
pasted below.


import java.sql.*;
public class SMSDataBase {

private static Statement stmt;
private static Connection con;

public static void open(String URL,String username,String password)
{
URL="jdbcdbc:" + URL;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(Exception e)
{
System.out.println("failed to load JDBC/ODBC driver");
return;
}
stmt=null;
con=null;

try {
con=DriverManager.getConnection(URL,username,passw ord);
stmt=con.createStatement();
con.setAutoCommit(false);

}catch(Exception e) {
System.err.println("problems connection to " +URL);
}


}
public synchronized static void insert(String SQL)
{

if(con!=null)
{
try {
stmt.executeUpdate(SQL);
con.commit();
}catch(Exception e)
{
System.err.println("problems with sql sent to"+":"+e.getMessage());
}
}
else
{
System.err.println("no connection with the database");
}

}
public synchronized static void listrecords()
{
String SQL="select * from sms;";
try{
ResultSet rs=stmt.executeQuery(SQL);
while(rs.next()){
Main.textarea.append(rs.getString(1));
rs.deleteRow();
con.commit();
break;
}
}catch(Exception e) {}
}


public static void close()
{
try {
stmt.close();
con.close();
}catch(Exception e)
{
}
}

}