import java.io.IOException;
import java.io.PrintWriter;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class DeleteTableServlet extends HttpServlet
{
	public void doGet(HttpServletRequest req, HttpServletResponse res)
	 throws IOException, ServletException
	 {
		res.setContentType("text/html");
		PrintWriter pw = res.getWriter();
		Connection con;
		Statement st;
		try
		{
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
			con = DriverManager.getConnection("jdbc:odbc:dataInsert");
			st= con.createStatement();
			int i =st.executeUpdate("DROP TABLE data1");			
			pw.println("Tabel has been deleted successfully");
		}
		catch(SQLException sx)
		{
			pw.println(sx);
		}
		catch(ClassNotFoundException cx)
		{
			pw.println(cx);
		}
	 }
}
