import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class DeleteBlobFromServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException {
Connection conn = null;
PreparedStatement pstmt = null;
String id = "0001";
ServletOutputStream out = response.getOutputStream();
response.setContentType("text/html");
out.println("Delete Photo");
try {
conn = getHSQLConnection();
pstmt = conn.prepareStatement("delete from MyPictures where id = ?");
pstmt.setString(1, id);
pstmt.executeUpdate();
out.println("deleted photo with id=" + id + "
");
} catch (Exception e) {
out.println("Error=" + e.getMessage() + "