title: How to pass the values of user defined datatype variable to MS SQL from java using spring jdbc store procedure
body: <p>I have the below MS SQL store procedure with the user defined variable (<code>@Location</code></p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE PROCEDURE [Organization].[Organization_Insert]   
  (  
   @OrganizationID NVARCHAR(256),  
   @Location Locationtype ReadOnly
  )
  </code></pre>
  
  <p><code>@Location</code> has following attributes: OrganizationSubID, LocationCode</p>
  
  <p>Am using the below java class to invoke the store procedure,</p>
  
  <pre><code>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();
    }
  </code></pre>
  
  <p>Here, my question is, how to construct the <code>@Location</code> variable from java and pass it to the MS SQL database. (am using sqljdbc4.jar driver to connect the database)</p>
  
  <p>I whole day Googled and tried many implementations and nothing paid off.</p>
  
  <p>Please someone shed some lights on this...</p>