简体   繁体   中英

The best way to pass a null List to a Stored procedure

I have a scenario where in I have to pass two parameters. One is a BigInteger and another is a list of BigIntegers. The first parameter cannot be null but the second parameter which is a list can be coming as a null list from the request. The stored procedure will take care of rest of the things how to get the result even though second parameter is null. How can I handle this in java code in a decent way? Can I pass in the null list as it is?

In your stored procedure, you can mark the second parameter as Optional. When your second list is null, you can call the procedure with just one parameter from java.

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