An SDE workspace should implement that interface, unless it's an Sde3Workspace object. But to be honest, I don't know the difference between Sde3Workspace and Sde4Workspace.
As with all ArcObjects enumerators, you need to call
Reset() first, and then loop over the results using
Next(). Note that
ConnectedUsers may throw an exception if you do not have permission to see the connected users.
Unfortunately I don't know how to use the Java ArcObjects SDK, but I guess it should be very similar to C#, so here's an example:
private void GetConnectedUsers(IWorkspace workspace)
var connectionInfo = workspace as IDatabaseConnectionInfo3;
if (connectionInfo == null) return; // Other types of workspace, e.g. fgdb
listUserInfo = connectionInfo.ConnectedUsers;
catch (Exception ex)
// May not have permission to see connected users
while ((userInfo = listUserInfo.Next()) != null)