Java provides a number of features that make it ideal for use in the database:
Thorough error checking at compile time.
Built-in error handing with a well-defined error handling methodology.
Built-in garbage collection (memory recovery).
Elimination of many bug-prone programming techniques.
Strong security features.
Java code is interpreted, so no operations get executed without being acceptable to the Java VM.