Data Sources JDBC SQL statement

Li QingWen
Tera Contributor

I am currently connecting to an external system through JDBC.

 

I know that by writing the 'SELECT * FROM TABLE' statement in the 'SQL statement', I can obtain the content of the external database.

LiQingWen_0-1720690682925.png

 

But I would like to know if it is possible to write an 'Insert' statement in an 'SQL statement'? How to write variables?

If not, I want to know how to add data to an external database through JDBC.

thank!

3 REPLIES 3

Rajesh Chopade1
Mega Sage

Hi @Li QingWen 

 

The purpose of JDBC data source is gets data from the database by using the connection specified in the test step. The data source can either use a project database connection, or a connection specified only for the data source.

 

To add data to an external database you need to use the integration OR you can export data in excel format and import it in your external database.

 

I hope my answer helps you to resolve your issue.

 

Thank you

Rajesh chopade

Hi

I also encountered the same problem here. May I ask about adding data to an external database. What should be done specifically

Hi @ddd 

ServiceNow does not have the ability to write directly to an external database (e.g. SQL Server) using ODBC or JDBC. If the database has an exposed Web Service that allows records to be inserted, then you can call that Web Service. However, most database management systems do not provide such a service out-of-box.

Export Sets allow you to write an external file on a schedule (e.g. once/day). You then need to write a separate import process to load the file into your database.

There are various third-party products that will replicate your ServiceNow data to an external database on a schedule (e.g. daily or hourly). Please refer to this recent post for a discussion on some options:

https://community.servicenow.com/community?id=community_question&sys_id=76af370adba968506621d9d96896...

 

Thank you

Rajesh chopade