public boolean checkDuplicate(String checkThis, int choice) throws ClassNotFoundException, SQLException
    {       
        String query = "";
        if(choice == 0)
            query = "select suppvname from supplier where suppvname='"+checkThis+"'";
        else if(choice==1)//mabelle
            query = "select compvname from company where compvname-='"+checkThis+"'";
        else if(choice==2)//mabelle
            query = "select billid from or_hdr where billid='"+checkThis+"'";
        else if(choice==3)//mabelle
            query = "select orno from or_hdr where orno='"+checkThis+"'";
        PreparedStatement stmt = null;
        Connection con = null;
        ResultSet rs;

        try {
            Class.forName(DATABASE_CLASS);
            con = DriverManager.getConnection (DATABASE_URL, DATABASE_NAME, DATABASE_PASSWORD);
            stmt = con.prepareStatement(query);
        }
                
	catch (SQLException e) { }
        
        try {
            rs = stmt.executeQuery(query);
            if(!rs.next())
            {
                con.close();
                return true;
            }            
	}
        catch (SQLException e)
        {
            e.printStackTrace();
	} 
        con.close();
        return false;
    }