作者:不懂珍惜的林记热_713 | 来源:互联网 | 2023-05-19 05:32
IhaveaLinkedBlockingQueue,andIwouldliketosavealltheelementstothedatabase.IknowIca
I have a LinkedBlockingQueue, and I would like to save all the elements to the database. I know I can save it one by one:
我有一个LinkedBlockingQueue,我想将所有元素保存到数据库中。我知道我可以一个一个地保存它:
ObjectModel om = new ObjectModel();
om.save();
However, that means I have to loop through all the elements and do a new connection for each. Can I insert the entire list at once?
但是,这意味着我必须循环遍历所有元素并为每个元素建立新连接。我可以一次插入整个列表吗?
3 个解决方案