How to pass an NULL (or empty) array to a JDBC callableStatement (that expects an Array) -
i'm having trouble passing null value jdbc stored function (using callable statement) expects array type. problem if i'm trying set in parameter null (eg., can create , pass empty array, shouldn't have that).
for example, can work-around:
callablestatement.setobject(index, callablestatement.getconnection.createarrayof("numeric", array().asinstanceof[array[anyref]]))
but bothers me. first of all, there supposed api passing null arrays. second of all, i'm creating empty array no reason (and i'll have create correct array type not one-liner, i'll need support several different types). gets messy.
i should able this, think (or @ least pretty similar):
callablestatement.setnull(index, types.array)
but results in exception:
com.edb.util.psqlexception: error: function app_fetch_user_list_pkg.n_execute(character varying, character varying[], character varying, boolean, integer) not exist
any ideas? (we working postgresql/edb oracle... far, i've been experimenting postgresql instance).
well, i'm using preparedstatement.setnull(position, types.array)
9.4-1202-jdbc41 jdbc driver , working expected.
Comments
Post a Comment