function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Krishnan MishraKrishnan Mishra 

What is "Database" in database.batchable?

Can anyone please explain this statement :
global class ContactBatch implements Database.Batchable<sObject>{
}

As far as I know Database is a class in apex and batchable is an interface, So why can't we write as: 
global class ContactBatch implements Batchable{
}

Also, explain the syntax for <sObject> here
VJayVJay
Implementing the Database.Batchable Interface. ... To collect the records or objects to pass to the interface method execute , call the start method at the beginning of a batch Apex job. This method returns either a Database.QueryLocator object or an iterable that contains the records or objects passed to the job.
Krishnan MishraKrishnan Mishra
Hi VJay,
Thanks for your answer. What I am asking is the meaning of "Database" here. Is it a class/package, and why the interface is written that way. Generally we implement interface simply by class's name followed by interface name. Here we are using class name followed by DATABASE.interface's name why??
VJayVJay
Hi Krishnan,
Here Databse is clase and Batchable is a interface. 

In jave we are using import statement but here we are using class name dot interface name. 

Thanks 
Vijay 
Krishnan MishraKrishnan Mishra
In Java import statement is used to import a package not an interface, so Is Database a package here?
Andersen NesrAndersen Nesr
The "database" in database.batchable refers to the data that is being processed. In most cases, this data is stored in a database, such as a relational database. However, it is also possible to process data that is not stored in a database. This data is then said to be in a "batch."

Andersen  (https://andersenlab.com/services/data-development-services-with-andersen)software is a good example of a batchable software that can process data from multiple sources.