Embedded SQL was one of the most popular ways to execute SQL in C during the "old days" (C ++ had not yet been invented).
These days, we will mainly use the ORM library. It is not recommended to do embedded SQL anymore, because, as you put it, it depends on the proprietary preprocessor and makes it difficult to debug, manage and maintain code. It also binds you to one database provider, and your code will be extremely difficult to move to another database server. As a rule, we do not do this in "real life".
But since this is just a class, your professor is probably interested in teaching you SQL and database concepts. Embedded SQL is just a tool. You should learn SQL and databases, not embedded SQL in C ++.
However, I find that you are missing the point when asking about PHP and Java. Not to mention that PHP is a scripting language, and Java is another language in which you can (potentially) write a processor for embedded SQL.
So, your point about embedded SQL really has nothing to do with language selection. This is due to trade-offs and the balance between (1) a patented embedded system with a preprocessor, (2) using an ORM library or a data access library (e.g. ODBC).
Off-Topic:
At first I started using embedded SQL when I was in college (it was about 30 years ago!). In fact, he got programming from the College and still used it, but obviously that was on the way. I have never seen it used since 1990 or so.
Stephen chung
source share