Jdbc check for capability - savepoint release

前端 未结 2 1897
迷失自我
迷失自我 2021-01-18 08:46

I have generic jdbc code that works with all kinds of databases. I have some apis that work with transactions and savepoints.

The problem is that some databases req

相关标签:
2条回答
  • 2021-01-18 08:56

    In Oracle's 10g documentation, I could spot the fact that this particular JDBC / ojdbc method is not supported:

    Note: As of Oracle Database 10g, releaseSavepoint and oracleReleaseSavepoint are not supported. If you call either of the methods, then SQLException is thrown with the message "Unsupported feature".

    In 11g, the documentation seems to claim otherwise:

    You remove a savepoint using the Connection.releaseSavepoint(Savepoint svpt) method.

    But I can easily reproduce your issue also in 11g.

    0 讨论(0)
  • 2021-01-18 09:11

    If you can pass a DB vendor parameter into your class then you can simply map this behaviour for each vendor.

    0 讨论(0)
提交回复
热议问题