Write a JDBC program to delete the records of employees whose names are starting with ‘A’ character.

import java.sql.*;
public class Employee
{
    public static void main(String arg[])
    {
        try        {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection con=DriverManager.getConnection("jdbc:odbc:BCA");
            Statement stmt=con.createStatement();
            ResultSet rs=stmt.executeQuery("Select * from Employee");
            System.out.println(" EID "+" Ename "+" Address "+" Salary ");
            while(rs.next())
            {
                System.out.print(rs.getInt(1)+"\t");
                System.out.print(rs.getString(2)+"\t");
                System.out.print(rs.getString(3)+"\t");
                System.out.print(rs.getInt(4)+"\t");
                System.out.print("\n");
            }
            String s="delete from Employee where Ename like 'A%'";
            int n=stmt.executeUpdate(s);
            if(n>0)
            {
                System.out.println("Record is Deleted...!!!");
            }
            else            {
                System.out.println("Record is not found in table...!!!");
            }
            ResultSet rs1=stmt.executeQuery("Select * from Employee");
            System.out.println(" EID "+" Ename "+" Address "+" Salary ");
            while(rs1.next())
            {
                5                System.out.print(rs1.getInt(1)+"\t");
                System.out.print(rs1.getString(2)+"\t");
                System.out.print(rs1.getString(3)+"\t");
                System.out.print(rs1.getInt(4)+"\t");
                System.out.print("\n");
            }
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
}
**OUTPUT**
D:\TY\Adv Java>javac Employee.java D:\TY\Adv Java>java Employee EID Ename Address Salary 1 Sachin Loni 35000 2 Sanket Pune 40000 3 Yogesh Pandare 50000 4 Akshay Mumbai 20000 5 Ajay Baramati 15000 6 Ranjit Satara 10000 Record is Deleted...!!! EID Ename Address Salary 1 Sachin Loni 35000 2 Sanket Pune 40000 3 Yogesh Pandare 50000 6 Ranjit Satara 10000