logo

NJP

Changes to JDBC Probe and Time Insert to Oracle

Import · May 31, 2019 · article

We have been using the JDBC probe to insert records into an external oracle database for a couple of years now. We recently upgraded from Kingston to Madrid and our scripts quit working. It appears there has been some changes in the way the JDBC code sends timestamps to Oracle databases.

In previous code we used the following

var start_date = "TO_DATE('"+current.start_date+"', 'YYYY-MM-DD HH24:MI:SS')

and passed it to our JDBC using the following.

jdbc.addNumberField('PLANNED_START_DATE',start_date);

Now we are doing the following which works.

var start_date = current.start_date

jdbc.addTimestampField('PLANNED_START_DATE',start_date,'yyyy-MM-dd HH:mm:ss');

Hopefully this helps others.

View original source

https://www.servicenow.com/community/developer-articles/changes-to-jdbc-probe-and-time-insert-to-oracle/ta-p/2326766