An apparatus for extracting data from a database, comprising: a database interface configured to enable communication with the database; a database management system, DBMS configured to execute in the same process as a virtual machine, VM; a buffer comprising a plurality of memory regions; and a kernel generator configured to generate a data extraction kernel on the DBMS side and an object initialization kernel on the VM-side, the data extraction kernel comprising a DBMS-side buffer application programming interface, API, and being configured to read database data from a plurality of locations in the database using the database interface and write the database data to the buffer using the DBMS-side buffer API, the database data corresponding to a query result, the data extraction kernel further comprising a DBMS-side multi-cursor to extract the database data from the database, the DBMS-side multi-cursor comprising a plurality of cursors; and the object initialization kernel comprising a VM-side buffer API and being configured to read the database data from the buffer using the VM-side buffer API and to initialize a plurality of objects with the database data read from the buffer, the object initialization kernel comprising a VM-side multi-cursor to extract the database data from the buffer, the VM-side multi-cursor comprising a plurality of cursors; wherein information indicating one of the plural memory regions in the buffer where the data extraction kernel writes the database data is known to the DBMS-side buffer API and to the VM-side buffer API; a cursor of the DBMS-side multi-cursor being configured to iterate over items of the database data in one of the plural locations in the database independent of the locations of the other cursors of the DBMS-side multi-cursor, a cursor of the VM-side multi-cursor being configured to iterate over items of the database data synchronously with the iteration of the cursor of the DBMS-side multi-cursor, and the kernel generator being configured to generate the object initialization kernel based on a first isomorphism between respective object types of the plurality of objects and a data format of the region layout in the buffer and the data extraction kernel based on a second isomorphism between a data format of the database data in the database interface and the data format of the region layout in the buffer, wherein the first isomorphism and the second isomorphism are input to the kernel generator. a database interface configured to enable communication with the database; a database management system, DBMS configured to execute in the same process as a virtual machine, VM; a buffer comprising a plurality of memory regions; and a kernel generator configured to generate a data extraction kernel on the DBMS side and an object initialization kernel on the VM-side, the data extraction kernel comprising a DBMS-side buffer application programming interface, API, and being configured to read database data from a plurality of locations in the database using the database interface and write the database data to the buffer using the DBMS-side buffer API, the database data corresponding to a query result, the data extraction kernel further comprising a DBMS-side multi-cursor to extract the database data from the database, the DBMS-side multi-cursor comprising a plurality of cursors; and the object initialization kernel comprising a VM-side buffer API and being configured to read the database data from the buffer using the VM-side buffer API and to initialize a plurality of objects with the database data read from the buffer, the object initialization kernel comprising a VM-side multi-cursor to extract the database data from the buffer, the VM-side multi-cursor comprising a plurality of cursors; wherein information indicating one of the plural memory regions in the buffer where the data extraction kernel writes the database data is known to the DBMS-side buffer API and to the VM-side buffer API; a cursor of the DBMS-side multi-cursor being configured to iterate over items of the database data in one of the plural locations in the database independent of the locations of the other cursors of the DBMS-side multi-cursor, a cursor of the VM-side multi-cursor being configured to iterate over items of the database data synchronously with the iteration of the cursor of the DBMS-side multi-cursor, and the kernel generator being configured to generate the object initialization kernel based on a first isomorphism between respective object types of the plurality of objects and a data format of the region layout in the buffer and the data extraction kernel based on a second isomorphism between a data format of the database data in the database interface and the data format of the region layout in the buffer, wherein the first isomorphism and the second isomorphism are input to the kernel generator.