File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Qry for Number Of User Connected to SQL/Oracle Database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Qry for Number Of User Connected to SQL/Oracle Database." Watch "Qry for Number Of User Connected to SQL/Oracle Database." New topic
Author

Qry for Number Of User Connected to SQL/Oracle Database.

sanmahicog sanmahicogg
Greenhorn

Joined: Jul 23, 2012
Posts: 2
What is the query to find the no of user connected to Oracle database or SQL database ?
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

Welcome to the Ranch!

I'm afraid such functionality is vendor-specific. I cannot help with other databases, but in Oracle you might probably query the V$SESSION performance view (and count number of rows), although you need quite powerful privileges to be able to do this. There might even be a better dynamic view which would contain the aggregated number of sessions, you might want to look in more detail yourself.

Be careful when interpreting the number you get this way. Some users can have several active connections of their own, and conversely one connection can be shared by many users (if it is a connection managed by connection pool on an application server, for example).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Qry for Number Of User Connected to SQL/Oracle Database.
 
Similar Threads
Hibernate does not return any result
accept command in .sql file not working from ant
JDBC and database
web application concurrent access
web application works fine with us and canada time