How is Java executed in the database?

When Adaptive Server encounters a Java statement within an executing SQL statement, the server invokes the JVM to execute the statement. If the JVM is already running, the Java invocation is forwarded to it; if this is the first Java request, the JVM starts automatically. The JVM locates and loads the class identified by the Java statement and executes the byte code.