摘要 |
In accordance with an embodiment, described herein is a system and method for compacting a pseudo linear byte array, for use with supporting access to a database. A database driver (e.g., a Java Database Connectivity (JDBC) driver) provides access by software application clients to a database. When a result set (e.g., ResultSet) is returned for storage in a dynamic byte array (DBA), in response to a database query (e.g., a SELECT), the database driver determines if the DBA is underfilled and, if so, calculates the data size of the DBA, creates a static byte array (SBA) in a cache at the client, compacts the returned data into the SBA, and stores the data size as part of the metadata associated with the cache. In accordance with an embodiment, the DBA and the SBA can use a same interface for access by client applications. |
主权项 |
1. A system for compacting a pseudo linear dynamic byte array (DBA) for storing a result set in a client cache, comprising:
a computer including memory and one or more microprocessors;
an application server;a cache in a memory space of the application server; anda database driver, that provides access by a software application to a database, wherein the database driver operates to
store a result set returned from the database into a dynamic byte array (DBA) in the memory space,calculate a size of data in the DBA, andcompact the data in the DBA into a static byte array in the cache. |