does rails cache the database connection?

Depends on what you mean.

It opens a persistent connection per Rails instance (1 per Rails backend, one each per mongrel, fastcgi, etc).

It does not do any sort of connection pooling, however.