Why is there more than one kind of car? Or more than one type of television set?
Each programming language has different strengths and weaknesses.
Java is great at implementing OOP solutions. It also has the advantage of creating applications that are easily portable from one platform to another. But using SQL to read a database in Java requires one to jump through some hoops. Also, it doesn't generate true executable files, so Java apps require a run-time engine in order to run.
On the other hand Oracle's PL/SQL language (which is not just SQL but full-blown procedural language) is designed around interaction with the database and is much better suited for working with data in an Oracle database. One needs no "connection strings" or JDBC or ODBC or top-link or anything else to work with the database from PL/SQL. However, it needs additional tools such as Oracle Forms or the OWA (Oracle Web Application) toolkit before it can create GUI interfaces, And, of course, it is Oracle Proprietary and you just can't get it without getting the Oracle Database. Also, it doesn't create true executables so what you write needs the Oracle PL/SQL engine to run.
C++ meanwhile does generate true machine-language executable files and thus need no run-time engine. Also, the executable code often executes faster than the byte-code created by Java, though Java's technology has been refined to the point where the differences in speed are far less than they once were. However, this means that if you want to run your application on a different platform, you have to find the appropriate compiler and re-compile your program. And often differences in platforms make it necessary to adjust your code. Connecting to databases with SQL also requires some hoop-jumping like in Java.
Frankly, if you're writing a batch program that processes data in sequential files arranges in fixed-length fields, then COBOL still has certain advantages that no other language can beat even today. Also, COBOL may be the easiest language on the planet to learn. However, if you want to build a GUI in it .... well, some modern versions have extensions for doing it, but the language wasn't really designed for that.
There are people who still prefer FORTRAN for writing code that's heavy on doing scientific calculations. It was designed specifically for precise mathematical calculations for scientific research and engineering.
Each language has it's advantages and disadvantages. No one language is best at everything. That's why we have so many different languages. Each language was written to serve slightly different purposes.