I asked about this on the SQuirreL mailing list, but I'm having trouble getting a response.
I often use SQuirreL to browse Oracle dbs. If the connection times out, I just use the "Reconnect" menu item, and it reopens the connection perfectly fine.
I'm now working with some MariaDB databases. When I attempt to reconnect, I just get a "Connection is close" error in SQuirreL. I find that if I completely close the pane and start a new connection to the alias, it successfully connects.
I know that in my Tomcat instance that connects to this db, I have to set some flags to "test" the connection at certain points, to flush connections that get into a bad state. I imagine my fix would be to configure the connection in SQuirreL to do something similar, but I don't see an obvious way to do this in SQuirreL. I can see that there are some property settings that I can set, but it's not really clear exactly how I should be doing this.
I also asked about this on the squirrel-users mailing list, and Gerd Wagner gave me a useful reply:
Right click your Alias -> Alias properties -> Tab 'Connection'. The SQL entered there will be executed periodically with configurable repeat time.
I still note that I see different behavior from MariaDB connections, compared to Oracle connections. The change that Gerd recommends works, but note that this results in essentially a permanent connection to the database (assuming the server doesn't go down). When I make connections to Oracle dbs, the connections time out, but using "Reconnect" just restores them. These MariaDB connections are not "Reconnect"able, for some reason.