JDBC File Loader (via MID Server)

enojardi
ServiceNow Employee
ServiceNow Employee

How many times have you thought? I wish I could use JDBC to connect and extract data from a flat file instead of a database.

Well… This application (first release / beta version) does exactly that… and more:

* Connect using JDBC to a file via the MID Server

* Support for any flat file (CSV, TXT, etc)

* Support for zipped (.zip) files (containing a flat file)

* Choose any column separator you like

* Choose header row number or no header row at all

* Support for wildcard (*) and dynamic (scripted) file names

* Support for processing multiple files at once (using * wildcard)

* Load all rows from the file or execute your own "SELECT" SQL statement

* Select Import Set mode: Load only or Load & Transform (if a map is available)

* Bonus (experimental): onComplete file action: Copy, Move, Rename or Delete the file!

Link to App in Share: ServiceNow Share

70 REPLIES 70

erikbos
Giga Contributor

Of course, I have attached it to the original post.



Regards, e


chalverson1971
Tera Contributor

I have this running in a sandbox environment now and will likely be rolling this into production in our next release. This solves an issue with the Scheduled File Import we've been using until getting errors post Eureka upgrade.   I like the ability to determine file path dynamically since we intake files with the current date as part of the file name. This will become a staple utility.



Nice work!


Thanks, Chris!


Jonatan,



Having some issues with the solution in Geneva.   You've updated the description with the following statement, "Note: for Geneva, you may need to add/modify the "run script" on the scheduled jobs to global.JDBCFileLoader(current).execute() to run the data imports"   Can you elaborate?


Hi Chris, Sorry for the confusion, what I meant is that the field "script" on the u_jdbc_file_source has this default value (via a dictionary override: sys_dictionary_override:c5fd98f16f0475008a9810bd5d3ee478) for all new Scheduled Jobs:



new JDBCFileLoader(current).execute()



This needs to change to (and also updating any existing jobs)



new global.JDBCFileLoader(current).execute()



Does that make sense?



Cheers,


Jonny