문제

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