How to create a custom MBean from an SQL Query in WebLogic server using WLSDM Generic DevOps
Oracle SQL Run-time Transformation: SQL Result Set to Java JMX MBeans (by Govindan Padmanaban)
In my previous post, I have explained creating a custom MBean in WebLogic using Shell/Batch script using WLSDM. This post is the continuation of my earlier post, about creating a WebLogic MBean from an SQL query. We don’t require to write a single line of Java code or follow any MBean rules to create and register an MBean. All we need is SQL Query skills and navigation knowledge of WLSDM.
In this post, we are going to register a WebLogic MBean using WLSDM. After that, we can view the MBean attribute dynamically at runtime in WLSDM smart dashboard. Also, we can access this MBean attributes in external Java application. Let’s begin with an example
Here we are going to Create an MBean which read the total salary of IT Programmer.
MBean Name = SALARYBYJOB
MBean attribute name = TOTAL_SALARY
SQL Query = select job_id, sum(salary) as TOTAL_SALARY from employees where job_id = ‘IT_PROG’ group by job_id