Вопрос

I am migrating Pro*COBOL and Pro*C (code with embedded SQL) to Java.

Am I right that I should move migrate all of the embedded SQL to JDBC calls?

Or is there a sort of "Pro*Java" way that Oracle would recommend? What is the usual best practice?

Это было полезно?

Решение

Yes.

There was (or is?) SQLJ for embedding SQL into Java, but I have never seen that in use anywhere.

Everything SQL-based in Java goes via JDBC.

A usual practice (not sure if a "best practice") is to abstract even further and use an ORM and some kind of persistence API.

Другие советы

As there is no easy way to migrate C or worse COBOL to Java you will be doing a lot of re-writing anyway. So using JDBC with your existing SQL is probably the easiest way to go.

Another poster mentioned SQLJ which is a possibility, however I don't think it really gains you anything as you will be doing so much re-factoring anyway, however if you are happy with the whole pre-compiler thing then it will work! (At least for Oracle or DB2, support is patchy for the freebie databases).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top