How to shutdown Derby in-memory database Properly

后端 未结 3 1445
一个人的身影
一个人的身影 2020-12-28 19:24

I\'m using derby as an embedded database. Furthermore, I\'m using it\'s in-memory database option for my unit tests.

What I can\'t figure out is how to properly shu

3条回答
  •  悲&欢浪女
    2020-12-28 20:14

    I believe that your first code example is fine. The SQL State difference that you are seeing, I believe, is because you are running Derby embedded, but the example code that you saw (with SQL state XJ015) was running in a client-server configuration.

    As you noted, the SQLNonTransientConnectionException is a subclass of SQLException, so I am confused as to why you think you are not getting the right type of exception.

提交回复
热议问题