Wednesday, July 21, 2021

IMP OIM LINKS

 https://smconsultant.com/oracle-soa-tutorial/


connect By


It builds a hierarchical query.

There are 2 components to is:

"start with" -- this identifies all LEVEL=1 nodes in the tree

"connect by" -- describes how to walk from the parent nodes above to their children and their children's children.

Easiest to use an example on emp. If we start with "where mgr is NULL", we generate the set of employees that have no mgr (they are at the top of the tree). If we

CONNECT BY PRIOR EMPNO = /* current */ MGR

that will take all of the PRIOR records (the start with at first) and find all records such that the MGR column equals their EMPNO (find all the records of people managed by the people we started with).

Using EMP, the start with SET is:

scott@ORA8I.WORLD> select ename, empno, mgr from emp
2 where mgr is null;

ENAME EMPNO MGR
---------- ---------- ----------
KING 7839


Now, if we do the "connect by manually" we would find:

scott@ORA8I.WORLD> select ename, empno, mgr
2 from emp where mgr = 7839;

ENAME EMPNO MGR
---------- ---------- ----------
JONES 7566 7839
BLAKE 7698 7839
CLARK 7782 7839

scott@ORA8I.WORLD>


KINGS empno is the prior empno. If we build the entire hierarch -- we have:



scott@ORA8I.WORLD> select lpad(' ',level*2,' ')||ename ename, empno, mgr
2 from emp
3 START WITH MGR IS NULL
4 CONNECT BY PRIOR EMPNO = MGR
5 /

ENAME EMPNO MGR
--------------- ---------- ----------
KING 7839
JONES 7566 7839
SCOTT 7788 7566
ADAMS 7876 7788
FORD 7902 7566
SMITH 7369 7902
BLAKE 7698 7839
ALLEN 7499 7698
WARD 7521 7698
MARTIN 7654 7698
TURNER 7844 7698
JAMES 7900 7698
CLARK 7782 7839
MILLER 7934 7782

14 rows selected.

So, KING is the start with the set then JONES BLAKE and CLARK fall under him. Each of them becomes the PRIOR record in turn and their trees are expanded.



select Level, UT.USR_UDF_AGPERSONID USER_ID, UT.USR_LOGIN USER_NAME, UT.USR_DISPLAY_NAME, UT.USR_FIRST_NAME FIRST_NAME,UT.USR_LAST_NAME LAST_NAME, (select MT.USR_LOGIN from USR MT where MT.USR_key = UT.USR_MANAGER_KEY) MANAGER_NAME, UT.USR_MANAGER_KEY, UT.USR_STATUS STATUS, SYS_CONNECT_BY_PATH(UT.USR_LOGIN, '::') PATH from USR UT where level in (1, 2) and UT.USR_STATUS = 'Active' START WITH UT.USR_MANAGER_KEY=? CONNECT BY PRIOR UT.USR_KEY = UT.USR_MANAGER_KEY order siblings by UT.USR_KEY;

Saturday, May 23, 2020

IMP QUERY

---
SELECT
   USR_FIRST_NAME,
   USR_LAST_NAME,
   USR_LOGIN,
   USR_DISPLAY_NAME,
   USR_EMP_TYPE,
   USR_UDF_AGPERSONID,
   USR_STATUS,
   USR_UDF_AGEMPLOYEETYPE,
   USR_UDF_AGEFFTERMINATIONDATE,
   USR_UDF_AGSTATUS,
   USR_UDF_AGASSIGNMENTSTARTDATE
FROM
   USR
WHERE
   USR_UDF_AGPERSONID = ' '
order by
   USR_UDF_AGPERSONID

--- Get Request Information based on Resource history
SELECT
      osi.REQUEST_KEY,
      SCH.SCH_ACTUAL_START,
      SCH.SCH_ACTUAL_END,
      SCH.SCH_DATA,
      MIL.MIL_CONDITIONAL,
      orc.orc_key,
      MIL.MIL_NAME,
      usr.usr_login,
      usr.usr_email,
      sch.sch_status
   from
      osi,
      sch,
      mil,
      orc,
      usr,
      oiu
   where
      orc.orc_key = osi.orc_key
      and sch.sch_key = osi.sch_key
      and oiu.orc_key = orc.orc_key
      and oiu.usr_key = usr.usr_key
      and osi.mil_key = mil.mil_key
      and osi.REQUEST_KEY is not null
      and osi.REQUEST_KEY = '28472' --and  SCH.SCH_DATA = 'User not requested for PAN profile'
   order by
      sch.sch_key desc --and sch.sch_status='R'
--- Get Object infromation
select
            *
         from
            OIU
            SELECT
               OBJ.OBJ_NAME,
               USR_LOGIN,
               OST_STATUS,
               OIU_CREATE
            FROM
               OBJ,
               OBI,
               OIU,
               OST,
               USR
            WHERE
               OBJ.OBJ_KEY = OBI.OBJ_KEY
               AND OBI.OBI_KEY = OIU.OBI_KEY
   AND OIU.USR_KEY=USR.USR_KEY
               AND OIU.OST_KEY = OST.OST_KEY
               AND OST.OBJ_KEY = OBJ.OBJ_KEY
   and USR_LOGIN = '<<>>'
               and OBJ.OBJ_NAME= 'AD USER'
               and oiu.orc_key = '179812' --AND OBJ.OBJ_NAME=' [Insert Resource Name here]'
               --AND OST.OST_STATUS IN ('Enabled','Provisioned');

--Get OST Status Based on Orc key
select
                  OST_STATUS,
                  OIU_CREATE
               from
                  OIU,
                  OST
               where
                  OIU.OST_KEY = OST.OST_KEY
                  and oiu.orc_key = '179812'

--- adapter Information
SELECT
                     mil.mil_name,
                     MIl.Mil_kEY,
                     ADJ.ADJ_METHOD,
                     ADJ.ADJ_Constructor,
                     ADJ.ADJ_METHOD_DISPLAY,
                     adj.adj_jar_file,
                     ADT.ADT_NAME,
                     ADT.ADT_TYPE,
                     adp.adp_name,
                     adp.adp_description,
                     evt.evt_name,
                     mil.mil_name,
                     adv.adv_name,
                     adv.adv_desc,
                     adv.adv_data_type,
                     adv.adv_map_value,
                     adm.adm_display_value,
                     adm.adm_map_value,
                     atp.atp_in_out_flag,
                     atp.atp_type
                  from
                     ADJ,
                     ADT,
                     ADP,
                     evt,
                     mil --,ars
,
                     adV,
                     adm,
                     atp
                  where
                     ADJ.ADT_KEY = ADT.ADT_KEY
                     AND ADT.ADP_KEY = ADP.ADP_KEY
                     AND adp.evt_key = evt.evt_key
                     and evt.evt_key = mil.evt_key ---check process
                     --and adp.adp_key = ars.adP_Key
                     AND ADP.ADP_KEY = ADv.ADP_KEY
                     And ADT.ADT_KEY = atp.ADT_KEY
                     and atp.atp_key = adm.atp_key
                     And atp.atp_in_out_flag = 'Input'
                     and mil.mil_name in
                     (
                        <<MIL_NAME>>
                     )
                  order by
                     mil.mil_name
                  
SELECT  USR.USR_LOGIN, OSI.SCH_KEY,SCH.SCH_STATUS,STA.STA_BUCKET,MIL_NAME , PKG.PKG_NAME,OBJ.OBJ_NAME,SCH.SCH_DATA,SCH.SCH_REASON FROM  
                OSI,SCH,STA,MIL,TOS,PKG,OIU,USR,OBJ,OST  
                WHERE OSI.MIL_KEY=MIL.MIL_KEY  
                AND SCH.SCH_KEY=OSI.SCH_KEY  
                AND STA.STA_STATUS=SCH.SCH_STATUS  
                AND TOS.PKG_KEY=PKG.PKG_KEY  
                AND MIL.TOS_KEY=TOS.TOS_KEY  
                AND OIU.USR_KEY=USR.USR_KEY  
                AND OIU.OST_KEY=OST.OST_KEY  
                AND OST.OBJ_KEY=OBJ.OBJ_KEY  
                AND OSI.ORC_KEY=OIU.ORC_KEY  
                and OIU.OIU_key =  ?   
                and STA_BUCKET = 'Rejected'  
                order by SCH_KEY desc  
                FETCH NEXT 1 ROWS ONLY;


  SELECT  USR.USR_LOGIN, OSI.SCH_KEY,SCH.SCH_STATUS,STA.STA_BUCKET,MIL_NAME ,SCH.SCH_DATA,
SCH.SCH_REASON,STA_BUCKET, SCH.SCH_ACTUAL_END,SCH.SCH_ACTUAL_START FROM  
                OSI,SCH,STA,MIL,TOS,PKG,OIU,USR,OBJ,OST  
                WHERE OSI.MIL_KEY=MIL.MIL_KEY  
                AND SCH.SCH_KEY=OSI.SCH_KEY  
                AND STA.STA_STATUS=SCH.SCH_STATUS  
                AND TOS.PKG_KEY=PKG.PKG_KEY  
                AND MIL.TOS_KEY=TOS.TOS_KEY  
                AND OIU.USR_KEY=USR.USR_KEY  
                AND OIU.OST_KEY=OST.OST_KEY  
                AND OST.OBJ_KEY=OBJ.OBJ_KEY  
                AND OSI.ORC_KEY=OIU.ORC_KEY  
                and OIU.ORC_KEY  =  ?   
                order by SCH_KEy


# Query to check resource account status
SELECT USR.USR_LOGIN, OST.OST_STATUS, OBJ.OBJ_NAME, OIU.ORC_KEY  FROM USR
INNER JOIN OIU ON USR.USR_KEY = OIU.USR_KEY
INNER JOIN OST ON OST.OST_KEY = OIU.OST_KEY
INNER JOIN OBI ON OBI.OBI_KEY = OIU.OBI_KEY
INNER JOIN OBJ ON OBI.OBJ_KEY = OBJ.OBJ_KEY



SELECT MIL.MIL_NAME,EVT.EVT_NAME,OBJ.OBJ_NAME FROM OBJ JOIN PKG ON  PKG.OBJ_KEY=OBJ.OBJ_KEY JOIN TOS ON TOS.PKG_KEY=PKG.PKG_KEY JOIN MIL ON
MIL.TOS_KEY=TOS.TOS_KEY  LEFT OUTER JOIN EVT ON MIL.EVT_KEY=EVT.EVT_KEY
where OBJ.OBJ_NAME =  'UNIX User'

SELECT MIL.MIL_NAME,EVT.EVT_NAME,OBJ.OBJ_NAME FROM OBJ JOIN PKG ON  PKG.OBJ_KEY=OBJ.OBJ_KEY JOIN TOS ON TOS.PKG_KEY=PKG.PKG_KEY JOIN MIL ON
MIL.TOS_KEY=TOS.TOS_KEY  LEFT OUTER JOIN EVT ON MIL.EVT_KEY=EVT.EVT_KEY
where OBJ.OBJ_NAME =  'UNIX User'

SELECT 
mil.mil_name,MIl.Mil_kEY,
ADJ.ADJ_METHOD,ADJ.ADJ_Constructor,ADJ.ADJ_METHOD_DISPLAY,adj.adj_jar_file,
ADT.ADT_NAME,ADT.ADT_TYPE,
adp.adp_name,adp.adp_description,
evt.evt_name,
mil.mil_name
,adv.adv_name,adv.adv_desc,adv.adv_data_type,adv.adv_map_value
,adm.adm_display_value,adm.adm_map_value
,atp.atp_in_out_flag,atp.atp_type
--,ars.ars_code_name ,ars_desc
from ADJ,ADT,ADP,evt,mil,OBJ,PKG,TOS
--,ars
,adV,adm,atp
where ADJ.ADT_KEY = ADT.ADT_KEY
and OBJ.OBJ_NAME =  'UNIX User'
and PKG.OBJ_KEY=OBJ.OBJ_KEY
and TOS.PKG_KEY=PKG.PKG_KEY
and MIL.TOS_KEY=TOS.TOS_KEY
and 
AND ADT.ADP_KEY = ADP.ADP_KEY
AND adp.evt_key = evt.evt_key
and evt.evt_key= mil.evt_key
---check process
--and adp.adp_key = ars.adP_Key
AND ADP.ADP_KEY = ADv.ADP_KEY
And ADT.ADT_KEY = atp.ADT_KEY
and atp.atp_key=adm.atp_key 

Saturday, March 28, 2020

Installation of OIM PART1

Setting-up an Oracle Identity Manager 11gR2 PS2 environment

Contents
1.      Installing a database for Identity Management suite
2.      Execute Repistory Creation Utility (RCU)
3.      Install JDK
4.      Install Oracle Weblogic 10.3.6
5.    Install SOA 11.1.1.7
6.    Install OIM
7.    Configure OIM Server and Design Console Oracle Identity and Access Management 11gR2 PS2
8.    Configuring Weblogic for OIM
9. Configure OIM Server and Design Console

1.      Installing a database for Identity Management suite.
                                                        i.            Download Oracle Database 11 g Release 2 for Microsoft Windows from https://www.oracle.com/database/technologies/oracle-database-software-downloads.html.

                                                        i.            Download and unzip both files to the same directory ( here C drive)
                                                       ii.            Run setup.exe


                                                     iii.            If received an error, check for Oracle Hardware Minimum requirements for database installation are met.  

                                                     iv.            Click on ‘yes’

                                                       v.            Click on next on the step Configure Security Updates
                           
                                                     vi.            Select Create and Configure database on the installation Option step, click on next
                                                   vii.            Select System Class
                                                 viii.            On step Typical Installation enter the details , set Global database name as OMDB(in our case) and set administrative password. Click on Next
                                                     ix.            Prerequisite Checks are completed, click on next

                                                       x.            Review the Summary window to verify what is to be installed. Then, click Install


                                                     xi.            The Progress window appears

                                                   xii.            Once Database installation is completed, Configuration Assistant Window appears.

                                                 xiii.            Click OK

                                                 xiv.            Click Exit
                                                   xv.            To Test Database Installation is Completed successfully, Login to the Database Control URL in the Configuration assistant window https://localhost:1158/em


                                                 xvi.            Enter SYSMAN as the User Name and enter the Password, and then click Login
                                               xvii.            The database Control Home page appers. Thus installation was successful

Tuesday, August 22, 2017

Constructors in Java

  1. Every class has a constructor whether it’s a normal class or a abstract class.
  2. Constructors are not methods and they don’t have any return type.
  3. Constructor name should match with class name .
  4. Constructor can use any access specifier, they can be declared as private also. Private constructors are possible in java but there scope is within the class only.
  5. Like constructors method can also have name same as class name, but still they have return type, though which we can identify them that they are methods not constructors.
  6. If you don’t implement any constructor within the class, compiler will do it for.
  7. this() and super() should be the first statement in the constructor code. If you don’t mention them, compiler does it for you accordingly.
  8. Constructor overloading is possible but overriding is not possible. Which means we can have overloaded constructor in our class but we can’t override a constructor.
  9. Constructors can not be inherited.
  10. If Super class doesn’t have a no-arg(default) constructor then compiler would not insert a default constructor in child class as it does in normal scenario.
  11. Interfaces do not have constructors.
  12. Abstract class can have constructor and it gets invoked when a class, which implements interface, is instantiated. (i.e. object creation of concrete class).
  13. A constructor can also invoke another constructor of the same class – By using this(). If you want to invoke a parameterized constructor then do it like this: this(parameter list).

Difference between Constructor and Method


  1. The purpose of constructor is to initialize the object of a class while the purpose of a method is to perform a task by executing java code.
  2. Constructors cannot be abstract, final, static and synchronised while methods can be.
  3. Constructors do not have return types while methods do.
source : https://beginnersbook.com/2013/03/constructors-in-java/

Friday, June 2, 2017

9-key-interfaces-of-Collection-framework

9 Key Interfaces of Collection framework
  • Collection
  • List
  • Set
  • SortedSet
  • NavigableSet
  • Queue
  • Map
  • SortedMap
  • NavigableMap



Set Interface
.Duplicates are not allowed
Insertion order is not preserved.
Child interface of the collection.

1. Set is the child interface of Collection.
2. If we want to represent a group of individual objects as a single entity, where duplicates are not allowed and insertion order is not preserved then we should go for Set.
3. Set interface doesn’t contain any new methods. So we have to use only Collection interface methods.


Implementation classes: HashSet (1.2 v) and LinkedHashSet(1.4 v)



HashSet:

1. The underlying data structure is Hashtable.
2. Duplicates are not allowed. If we are trying to insert duplicates, we won’t get any compiletime or runtime errors. add() method simply returns false.
3. Insertion order is not preserved and all objects will be inserted based n hash-code of objects.
4. Heterogeneous objects are allowed.
5. ‘null’ insertion is possible.
6. implements Serializable and Clonable interfaces but not RandomAccess.
7. HashSet is the best choice, if our frequent operation is Search operation.


SortedSet

1. It is the child interface of set.
2. If we want to represent a group of individual objects according to some sorting order and duplicates are not allowed then we should go for SortedSet



Difference between List and Set?
ListSet
Duplicates are allowedDuplicates are not allowed
Insertion order preservedInsertion order not preserved

 SortedSet v Navigable Set
Child interface of Set.
Duplicates are not allowed.
Insertion order is preserved.










Navigable Set Interface:(1.6 v)
Child interface of SortedSet.
Implementation class: TreeSet (1.6 v).













Queue Interface:(1.5 v)
Child Interface of Collection.
A group of objects prior to process this can be used.
Implementation class: PriorityQueue, BlockingQueue, LinkedBlockingQueue, PriorityBlockingQueue.

MAP










implementation class for the Map class




Sorting:
1. Comparable(I) - default sorting
2. Comparator (I)  - Customized Sorting order
Cursors:(To retrive the items one by one)
1.Enumeration(I)
2. Iterator(I)
3. ListIterator(I)

Utility Classes: 
1. Collections
2. Arrays
Collection Interface:
1. If we want to represent a group of individual objects as a single entity then we should go for Collection
2. In general collection interface is considered as root interface of Collection Framework. 
3. Collection interface defines the most common methods which are applicable for any collection object
Methods of collection 




Note: Collection interface doesn’t contain any method to retrieve objects there is no concrete class which implements collection class direct
List Interface:
1. It is the child interface of Collection.
2. If we want to represent a group of individual objects as a single entity where duplicates are allowed and insertion order must be preserved then we should go for List.
3. We can differentiate duplicates by using index.
4. We can preserve insertion order by using index, hence index play very important role in list interface







ArrayList-details

The underlined data structure Resizable Array or Growable Array.
Duplicates are allowed.
Insertion order is preserved.
Heterogeneous objects are allowed ( Except TreeSet & TreeMap everywhere heterogeneous objects are allowed ).
Null Insertion is possible.

ArrayList Constructors:
1. ArralyList al= new ArrayList()
Creates an empty Array list object with default initial capacity 10.
Once Array List reaches its map capacity a new Array List will be created with new capacity=(currentcapacity*3/2)+1

ArrayList Constructors:
2. ArrayList al=new ArrayList(int initialCapacity);
3. ArrayList al=new ArrayList(Collection c);











Usually we can use collections to hold and transfer Objecs from one place to another place, to provide support for this requirement every Collection already implements Serializable and Cloneable interfaces. ArrayList and Vector classes implements RandomAccess interface so that we can access any Random element with the same speed. Hence if our frequent operation is retrieval operation then ArrayList is the best choice.
ArrayList:

1. ArrayList is best choice if our frequent operation is retrieval operation (Because ArrayList implements RandomAccess Interfaces)
2. ArrayList is the worst Choice if our frequent operation is insertion or deletion in the middle (Because several shift operation are require.

Differences-between-ArrayList-and-Vector-


-


















Synchronized-version-of-ArrayList




































LinkedList: 

1. The underlying data structure is Double LinkedList.
2. Insertion order is preserved.
3. Duplicates are allowed.
4. Heterogeneous Objects are allowed.
5. Null insertion is possible.
6. LinkedList implements Serializable and Clonable interfaces but not RandomAccess interface.
7. LinkedList is the best choice if our frequent operation is insertion or deletion in the middle.
8. LinkedList is the worst choice if our frequent operation is retrieval operation.
9. Usually we can use LinkedList to implement stacks and queues to provide support for this requirement LinkedList class defines following specific methods.


void addFirst();
void addLast();
Object getFirst();
Object getLast();
Object removeFirst();
Object removeLast();
 

LinkedList Constructors:

LinkedList l1=new LinkedList();
1. creates an empty LinkedList Object. LinkedList l1=new LinkedList(Collection c);
2. Creates an equivalent LinkedList Object for the given Collection.

Differences between ArrayList and LinkedList

Vector class details?

1. The underlying Data structure for the vector is resizable array or growable array.
2. Duplicate objects are allowed.
3. Insertion order is preserved.
4. 'null' insertion is possible.
5. Heterogeneous objects are allowed.
6. Vector class implemented Serializable, Cloneable and RandomAccess interfaces.
7. Most of the methods present in Vector are synchronized. Hence Vector object is Thread-safe.
8. Best choice if the frequent operation is retrieval. 

Vector Specific methods:

For adding objects:

1. add(Object o) [from collection – List(I)]
2. add(int index, Object o) [from List]
3. addElement(Object o) [from Vector]
4. For removing Objects:
5. Remove(Object o) [from collection]
6. removeElement(Object o) [from Vector]
7. remove(int index) [from List)
8. RemoveElementAt(int index) [from collection]
9. removeAllElements() [from Vector]
For Accessing Elements:
Object get(int index) [from Collection]
Object elementAt(int index) [from Vector]
Object firstElement() [from Vector]
Object lastElement() [from Vector]
Other Methods:
int size();
int capacity();
Constructors of vector class:

1. Vector v=new Vector();

Creates an empty vector object with default initial capacity 10, once vector reaches it’s max capacity a new vector object will be created with new capacity =2*current capacity.

2. Vector v=new Vector(int initialCapacity);

creates an empty Vector Object with specified initial capacity.

3. Vector v=new Vector(int initialCapacity, int incrementalCapacity);

4. Vector v=new Vector(Collection c);

Creates an equivalent Vector object for the given collection.

Stack class details (Collection Framework)?

1. It is a child class of Vector.
2. It is Specially designed class for Last in First Out order(LIFO)


Constructor of Stack:

Stack s=new Stack();

Methods in Stack:


1. Object push(Object obj);

For inserting an object to the stack.

2. Object pop():

TO removes and returns top of the stack.

3. Object peak();

To Returns the top of the stack without removal of object.

4. int search(Object obj);
if the specified object is available it returns its offset from top of the statck.
If the object is not available then it returns -1
.

5. Object pop();

For inserting an object to the stack

Three Cursors of Java - Enumeration

If we want to retrieve Objects one by one from the Collection, then we should go for Cursors.
There are three types of cursors are available in Java.

Enumeration
Iterator
ListIterator Enumeration:


Introduced in 1.0 version (for legacy) 

We can use Enumeration to get Objects one by one from the old Collection Objects(Legacy Collection).
We can create Enumeration Object by using elements() method of Vector Class. Public Enumeration elements(); 

Example: 

Enumeration e=v.elements(); 

Method of Enumeration 

Enumeration defines the following two methods

1. public Boolean hasMoreElements();
2. public Object nextElement();


















Iterator:

1. We can apply iterator concept for any Collection object hence it is universal cursor.
2. By using iterator we can perform both read and remove operations.We can create iterator object by using iterator() method of Collection Interface
public iterator iterator();


Example:


Iterator itr=C.Iterator();
Where C is any Collection Object.


Methods In Iterator

Iterator Interface defines the following three methods
1. public Boolean hasNext()
2. public Object next()
3. public void remove()
















Limitations of Iterator:

1. By using Enumeration and Iterator we can move only towards forward direction and we can’t move to the backward direction, and hence these are single direction cursors.
2. By using Iterator we can perform only read and remove operatiions and we can’t perform replacement of new Objects.


Note: 
To overcome above limitations of Iterator we should go for ListIterator



ListIterator: 

1. By using ListIterator we can move either to the forward direction or to the backward direction, and hence ListIterator is bidirectional cursor
2. By using ListIterator we can perform replacement and addition of new Objects in addition to read and remove operations.
3. We can create ListIterator Object by using listIterator() method of List Interface. public ListIterator listIterator() 


Example:

ListIterator itr=l.listIterator();

Where l is any List Object.

Note: ListIterator is the most powerful cursor but its limitation is, it is applicable only for List implemented class objects and it is not a universal cursor.




































Note: LinkedHashSet is the best choice to develop cache based applications, where duplicates are not allowed and insertion order must be preserved.


TreeSet 

1. The underlying data structure for TreeSet Is Balanced Tree
2. Duplicate objects are allowed.
3. Insertion order not preserved, but all objects will be inserted according to some sorting order.
4. Heterogeneous objects are not allowed. If we are trying to insert heterogeneous objects then we will get runtime exception saying ClassCastException.
5. Null Insertion is allowed, but only once.





















Null Acceptance:

1. For Empty TreeSet as the first element null insertion is possible. But After inserting that null if we are trying to insert any another element we will get NullPointerException.
2. For Non empty TreeSet if we are trying to insert Null then we will get NullPointerException.