import java.io.*;
import java.sql.*;
import java.util.Date;

public class DeleteItem
{
	public DeleteItem()
	{
	}

	public void loadDirver() throws ClassNotFoundException, Exception
	{
  		Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
	}


	public boolean delete(String num, String password) throws SQLException
	{
       		String url="jdbc:oracle:thin:@129.254.75.152:1521:orcl816";
        		Connection con;
       		Statement stmt;
       		boolean isNormalExit = false;

   		// DB Connect
   		con = DriverManager.getConnection(url, "scott", "tiger");
   		stmt = con.createStatement();

   		String query = "delete from board where bnum = " +  num + " and bpassword = '" + password + "'";
   		System.out.println(query);
   		int rs = stmt.executeUpdate(query);

   		if(rs == 1)
			isNormalExit = true;
		else
			isNormalExit = false;

   		stmt.close();
   		con.close();


		return isNormalExit;
	}
}
