Hello
A J2EE system communicates with the ABAP stack using the JCo RFC provider service which is based on the SAP JCo.
Go through these links to understand how they work.
Establishing a Connection Between AS ABAP and AS Java
http://help.sap.com/saphelp_nwmobile71/helpdata/en/3b/0c4b428f96ab53e10000000a1550b0/content.htm
SAP JCo Scenario: Java/ABAP Communication in the Application Server
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/708143872c1b5ae10000000a42189c/content.htm
RFC Communication Scenarios
http://help.sap.com/saphelp_nw73ehp1/helpdata/en/48/6ec38a20623ff6e10000000a42189c/content.htm
http://help.sap.com/saphelp_nw73ehp1/helpdata/en/48/6ec38a20623ff6e10000000a42189c/content.htm
Good Luck
RB