I tried a lot of things and got a solution at last..
Instead of VARRAY in Oracle a I created TABLE TYPE in SQL server like this:
CREATE TYPE dbo.Q_ARRAY
AS TABLE
(
Q_ID VARCHAR(11)
);
GO
This is used in a stored proc as an argument and I need to pass the string array to this stored proc from java.
I was able to do this with the below java code:
SQLServerDataTable qDT = new SQLServerDataTable();
vehDT.addColumnMetadata("Q_ID", java.sql.Types.VARCHAR);
vehDT.addRow("11122369");
vehDT.addRow("45523264");
SQLServerPreparedStatement spStat = (SQLServerPreparedStatement)con.prepareStatement("{call [dbo].[process_qRequest](?)}");
spStat.setStructured(1, "dbo.Q_ARRAY", qDT);
This is working like a champ!!
Here I am using sqljdbc41 jar.
Please note that the old sql jdbc jars doesnt provide many of these functionalities.
thanks,
Dave