开发者

Is it possible to pass an arraylist object to sql procedure with sql server 2000 and java 1.4?

开发者 https://www.devze.com 2022-12-08 10:45 出处:网络
I have defined a class FieldProperty with some of properties corresponding to field defined in it.ArrayList object contains objects of cla开发者_如何学JAVAss FieldProperty. now i want to store data in

I have defined a class FieldProperty with some of properties corresponding to field defined in it.ArrayList object contains objects of cla开发者_如何学JAVAss FieldProperty. now i want to store data in table .There is one record in table corresponding to each object of FieldProperty.if i call query for each record insertion.It will be very slow.Is there any way to pass object of arraylist to stored procedure and then i can retrieve data in stored procedure ?If this is not possible,What is best solution for this problem?

Platform Info Sql server 2000 java 1.4


Yes.

  1. Either send as CSV/XML etc amd parse into a table Arrays and Lists in SQL Server

  2. Use parameters, one per field (makes sense if fixed number of attributes per type)

  3. Staging table/bulk upload, copy to final table as part of stored proc call afterwards

0

精彩评论

暂无评论...
验证码 换一张
取 消