Mapping a single application to two databases, and having all the benefits of mapping to a single database, can be a challenge. To address this, Hibernate has a special project called Shards. So, if it's two separate databases you're trying to connect to, you might want to look at it. If you just want to do it very simply, you can have two SessionFactory objects, one for each database. But you won't be able to single entities to these two different databases, which is probably what you're looking for.