Which database is best depends on the needs of the database, not the language you use to connect to it. Since we don't know the needs of the database, we can't tell you which one would be best for you to use.
Java can be connected to any DB. If your data can be easily decomposed to tables, look at MySQL/PostgreSQL, if your data is flexible document , Mongo is better, if your data is graph, choose Neo4J etc