请在内存中有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()
时,上述代码无效。
请有人能告诉我怎么做吗?谢谢。