Are you sure that this is exactly what the message has inside?
"ORA-00001: unique constraint (WAJAHAT.INVOICE_UQ) violated"
Try first to print the message like this for exmple:
System.out.println(">>"+e1.getMessage()+"<<");
Then you will know exactly what the message prints.
An easier solution would also be:
if ( e1.getMessage().indexOf("WAJAHAT.INVOICE_UQ")!=-1 )