Wednesday, July 15, 2009

Monitoring JDBC Connection pool using WLST

Here is a sample:


def jdbcConnectionPoolStatus(server_name):
    try:
        cd('/ServerRuntimes/'+server_name+'/JDBCConnectionPoolRuntime')
        print '---------------------- JDBC Connection pool ---------------------'
        jdbcPool = ls()
        for jdbcname in jdbcPool.split():
            if jdbcname != 'drw-':
                cd('/ServerRuntimes/Desktop_managedServer_1/JDBCConnectionPoolRuntime/'+jdbcname)
                print 'Connection pool ' + jdbcname + ' is ' + cmo.getState()
    except:
        print "This Server has no JDBC Connection Pool"

No comments: