Implement prepared statement caching.