The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Getting NullPointerException in JDBC Prod during connection of ORACLE DB

Atul Kumar2
Giga Guru

Hi Team,

I am getting this below error in response entry in the ecc_queue via mid server during insert operation via JDBC Prod. Could you please suggest what to do. I am unable to access the hi article on the same which is mentioned in the other post related to this issue, can some one suggest how to fix this or post the content of the hi support article related to this.

!find_real_file.png

Regards,

Atul Kumar

1 ACCEPTED SOLUTION

Hi Tony,



Managed to resolve the issue by below code.



// Obtain MID Server


var mid = new GlideRecord('ecc_agent');


mid.addQuery('name','sdbx');


mid.query();


mid.next();




// Get a specific Data Source (predefined to connect to a specific database instance)


var ds = new GlideRecord('sys_data_source');


ds.addQuery('sys_id','b67a63a7dummy0128144b0ed');


ds.query();


ds.next();


gs.log("DataSource:" + ds.sys_id);




//Create a JDBC Probe to Select/Query


var u = new JDBCProbe(mid.name);


u.agent_correlator=u.addParameter('agent_correlator',gs.generateGUID());


u.setDataSource(ds.sys_id);


u.setTable("ODRPOC.INCIDENT");


u.setFunction("insert");


u.addField("SHORT_DESCRIPTION", "My chair will not roll smoothly");


u.addNumberField("PRIORITY", 1);


u.addField("URGENCY", "2");


u.addField("IMPACT", "1");


u.addField("IMPACT", "1");


u.create();




Thanks.



Regards,


Atul Kumar


View solution in original post

5 REPLIES 5

Hi Tony,



Managed to resolve the issue by below code.



// Obtain MID Server


var mid = new GlideRecord('ecc_agent');


mid.addQuery('name','sdbx');


mid.query();


mid.next();




// Get a specific Data Source (predefined to connect to a specific database instance)


var ds = new GlideRecord('sys_data_source');


ds.addQuery('sys_id','b67a63a7dummy0128144b0ed');


ds.query();


ds.next();


gs.log("DataSource:" + ds.sys_id);




//Create a JDBC Probe to Select/Query


var u = new JDBCProbe(mid.name);


u.agent_correlator=u.addParameter('agent_correlator',gs.generateGUID());


u.setDataSource(ds.sys_id);


u.setTable("ODRPOC.INCIDENT");


u.setFunction("insert");


u.addField("SHORT_DESCRIPTION", "My chair will not roll smoothly");


u.addNumberField("PRIORITY", 1);


u.addField("URGENCY", "2");


u.addField("IMPACT", "1");


u.addField("IMPACT", "1");


u.create();




Thanks.



Regards,


Atul Kumar