How to test the connection to a db2 database

℡╲_俬逩灬. 提交于 2019-12-20 01:36:21

问题


I need to test the connection to a db2 database.

With oracle databases I'd execute a 'select * from dual' in order to do this.

But dual is specific for oracle. Is there a similar canonical test sql statement for db2?


回答1:


SELECT 1 FROM SYSIBM.SYSDUMMY1

cheaper then

SELECT CURRENT SQLID FROM SYSIBM.SYSDUMMY1




回答2:


I ended up using

SELECT CURRENT SQLID FROM SYSIBM.SYSDUMMY1

which seems to work nice.




回答3:


LIST DB DIRECTORY

or

LIST TABLES


来源:https://stackoverflow.com/questions/4733356/how-to-test-the-connection-to-a-db2-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!