This ebuild fails on both of my gentoo systems with "cannot find java include files". I'm pretty confident they're on my system, but if they're not (or they aren't where db thinks they should be), it should install them as a dependancy :)
Please try to setup java with java-config. Make sure that you select a jdk, not a jre.
Also take a look at bug #26368
try doing: USE="-java" emerge db
That would not actually solve the problem, only circumvent it. If this is still a problem, please reopen the bug