将ArrayList对象作为参数传递给CopyManager postgres jdbc中的Copy.copyIn()

时间:2015-11-29 16:06:00

标签: java postgresql jdbc arraylist

请在内存中有ArrayList个条目,我想使用CopyManager jdbc类将它们插入到postgres表中。 这是经过考虑的代码片段:

characters_to_insert_at_once=1000;
CopyManager copyManager = new CopyManager((BaseConnection) conn); 
ArrayList<String>requestList;
long record_count = copyManager.copyIn("COPY 
requestListTable(col1,col2,col3,col4,col4)FROM STDIN",requestList,characters_to_insert_at_once);

但是,如上所示,当我将requestList作为参数传递给CopyManager.copyIn()时,上述代码无效。 请有人能告诉我怎么做吗?谢谢。

0 个答案:

没有答案