I need to print the below for any jdbc_data_source
found
expected output:
jdbc_data_source name is has username and jndi name <jndi_name>
which will print as
jdbc_data_source name is cwds
has username CAN_USER
and jndi name cwdsjndi
Here is my JSON:
[
{
“?xml”: {
“attributes”: {
“encoding”: “UTF_8”,
“version”: “1.0”
}
}
},
{
“jdbc_data_source”: [
{
“attributes”: {
“xmlns”: “http://xmlns.oracle.com/weblogic/jdbc_data_source”
}
},
{
“name”: “cwdsjndi”
},
{
“jdbc_driver_params”: [
{
“url”: “jdbc:oracle:thin:@//myhost.myshop.com:1521/OLTT206”
},
{
“driver_name”: “oracle.jdbc.OracleDriver”
},
{
“properties”: {
“property”: [
{
“name”: “user7”
},
{
“value”: “CAN_USER”
}
]
}
},
{
“password_encrypted”: “{AES}BcqmURyYoCkLvC5MmREXsfpRMO93KPIubqUAbb95+nE=”
}
]
},
{
“jdbc_data_source_params”: {
“jndi_name”: “cwds”
}
}
]
},
{
“?xml”: {
“attributes”: {
“encoding”: “UTF_8”,
“version”: “1.0”
}
}
},
{
“jdbc_data_source”: [
{
“attributes”: {
“xmlns”: “http://xmlns.oracle.com/weblogic/jdbc_data_source”
}
},
{
“name”: “dsvelcw”
},
{
“jdbc_driver_params”: [
{
“url”: “jdbc:oracle:thin:@myhost.myshop.com:1521:DB01”
},
{
“driver_name”: “oracle.jdbc.OracleDriver”
},
{
“properties”: {
“property”: [
{
“name”: “user”
},
{
“value”: “WEB_USER”
}
]
}
},
{
“password_encrypted”: “{AES}WYImLDLo0j7S80cGMUDsE5M5QTnpffTPGyIzDuGG6WU=”
}
]
},
{
“jdbc_data_source_params”: {
“jndi_name”: “dsvelcw”
}
}
]
}
]
All I could achieve so far is to read the json and loop over it as below: