Passing an ArrayList to an Oracle Stored Procedure in Java

Is there a way to pass a Java ArrayList object as a parameter to an Oracle stored procedure? I saw examples of passing an Array object to an Oracle stored procedure, but not an ArrayList object. Is it possible?

+3
source share
1 answer

No. If the Oracle stored procedure is in PL / SQL, you must convert the ArrayList (or any List implementation) to an array.

If your stored procedure is written in Java, you can serialize your ArrayList, send the byte stream to Oracle as a long string, and restore it on the Oracle side. I did this about 10 years ago for a client, and it worked very well. There are restrictions on the length of the string that you can pass through the Java-Oracle interface, so if your data structure is large, you will have to split it into pieces that will fit into one parameter, and Java on the Oracle side will accept several long lines.

+1
source

Source: https://habr.com/ru/post/1756578/


All Articles