简体   繁体   中英

How to Implement Session in a Desktop Java Swing Application that connects with an online database

I have a Java Swing Application that contains multiple Jpanel's with queries inside to manipulate data that is found on a mysql online database. I need a mechanism to implement session to this application so I can log out the user when his idle. Also am searching if i can store user activities when he's using the application in db table for example so I can go through them if something happen and know what the user has done! I know how to do the db part but I need someone to tell me how I can implement the SESSION and get the USER ACTIVITIES

thanks

您可以创建一个具有静态属性的类,以在用户连接时存储用户信息,还可以在用户表中添加一个包含用户状态的字段,当用户连接到在线状态时,否则将断开用户与状态线的连接

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM