Reputation: 1
How to to know how many connection established by an application to a database(Oracle). I have java web application connection to a oracle database. Just want to know how may connections are open to db when the application is running.
Upvotes: 0
Views: 40
Reputation: 4497
You can see the number of currently active sessions through querying the V$SESSION
table:
SELECT * FROM V$SESSION
You could then filter for specific users/programs to check how many parallel connections have been openend, i.e.
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT COUNT(*) AS cnt FROM V$SESSION WHERE program = 'executablename.exe';");
rs.next();
count = rs.getInt("cnt");
Upvotes: 1