In Apex, the Force.com database is already integrated into the language and runtime environment. There are no object-relational mapping tools or database connection pools to configure. Your Apex code is automatically aware of your database, including all of its objects and fields and the security rules protecting them.
This section examines the five ways the database is exposed in Apex code, which are summarized here:
1. Database records as objects—Database objects are directly represented in Apex as classes. These classes are implicitly imported into your code, so you’re always developing from the latest database schema.
2. Database queries—SOQL is a concise expression of the records to be queried and returned to ...