This is really, really (did I say really?) tricky to pull off in a non-brittle way. There are a few reasons for this:
-- A JDBC connection pool re-uses long-lasting connections over and over. This means that one connection could have different query types traversing it, and you'd need MBLB type functionality for the queries.
-- DB queries get complex. For example, it's not safe to say "send SELECT statements to the cache and INSERT to the R/W instance" because you can do an insert or some other R/W operation on a nested SELECT statement. I'm not a SQL person but I imagine that the list of possible edge cases is enormous.
-- You'd have to do some serious iRules work to get at the data stream and make decent decisions.
The list goes on, but that's enough for me :). It may be better to look at standing up a different connect string and using that for the cached queries, if possible. That can live behind a VIP as well.
-Matt