简体   繁体   中英

How to generate a JSON file from stored procedure(SQL) result

I want to get the data from DB using stored procedures in the form of JSon file. In simple words , my output should be json file which should be result of data in DB(based on stored procedure) .How can i move forward?

You have to create Object Mapper which will convert your data to an object (I think there's an apache library that can do this). Then you can use existing APIs to convert your objects to JSON string example of this is Google's or Jackson. When you have the JSON string you can now write it to a file. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM