对于 H2,使用:select * from information_schema.sessions; 对于 MySQL,请使用:show full processlist; 或者select * from information_schema.processlist; 如果您只对会话数量感兴趣,请使用 select count(*) 而不是 select *。
2 USER1 2011-05-27 09:09:44.98 null 2011-05-27 09:09:48.139 3 USER1 2011-05-27 10:56:32.769 选择从information_schema.sessions 2011-05-27 10:56:34.316 - Joe
select count(*) from information_schema.sessions;
select count(*) from information_schema.processlist;
从information_schema.sessions中选择计数(*);
从information_schema.processlist中选择计数(*);
- Thomas Mueller