I have the below MS SQL store procedure with the user defined variable (@Location
CREATE PROCEDURE [Organization].[Organization_Insert]
(
@OrganizationID NVARCHAR(256),
@Location Locationtype ReadOnly
)
@Location
has following attributes: OrganizationSubID, LocationCode
Am using the below java class to invoke the store procedure,
class OrganizationInsertProcedure extends StoredProcedure {
private final String[] outputParameters = new String[] {OUTPUT};
public PlanActivityInsertProcedure(DataSource dataSource) {
super(dataSource, "Organization_Insert");
declareParameter(new SqlParameter("@OrganizationID", Types.NVARCHAR));
declareParameter(new SqlParameter("@Location", Types.ARRAY, "Locationtype"));
compile();
}
Here, my question is, how to construct the @Location
variable from java and pass it to the MS SQL database. (am using sqljdbc4.jar driver to connect the database)
I whole day Googled and tried many implementations and nothing paid off.
Please someone shed some lights on this...