Your question is too vague to give the correct answer ...
If you plan to query the Oracle database from an external Java program (either in the Swing Application or in the Application Server), you need to learn two main APIs:
JDBC is the main API that allows a Java program to interact with any RDBMS, so you should at least know how it works, so when you have to dig into low-level code, you really know what happens.
JPA is the latest Java API for Persistence, which basically allows you to map a regular static Java object (AKA PoJo) with RDBMS table structures. There are several well-known implementations, but I would recommend Hibernate or TopLink as a starting point.
After that, you can start digging into other well-known frameworks, such as the Spring Framework, for some other RDBMS-related APIs.
source share