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

StackOverflow https://stackoverflow.com/questions/1576608

문제

I have defined a class FieldProperty with some of properties corresponding to field defined in it.ArrayList object contains objects of class 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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top