使用提示与jdbc调用

编程入门 行业动态 更新时间:2024-10-08 01:30:19
使用提示与jdbc调用-Spring jdbc批处理(Use of Hint with jdbc call -Spring jdbc batch)

我有两个与Spring jdbc批量插入有关的问题:如果有人可以帮我这个

问题1:场景:插入语句是: INSERT into EMPLOYEE_TABLE VALUES(....);

query = "INSERT into EMPLOYEE_TABLE VALUES(....)"; dbConnection.prepareStatement(query);

我可以对insert语句提示/*+APPEND_VALUES*/吗?我的意思是在jdbc调用中有提示是否有任何缺点?

问题2:ojdbc6.jar可以拥有的最大批量大小是多少?

提前致谢

I have two questions related to Spring jdbc batch insert : if anybody can help me on this

Question 1: Scenario : The insert statement is : INSERT into EMPLOYEE_TABLE VALUES(....);

query = "INSERT into EMPLOYEE_TABLE VALUES(....)"; dbConnection.prepareStatement(query);

Can I have hint /*+APPEND_VALUES*/ to the insert statement ?I mean Is there any disadvantage of having hint in jdbc call ?

Question 2 : What could be maximum batch size ojdbc6.jar can have ?

Thanks in advance

最满意答案

问题1 :我能想到的主要缺点是您依赖于仅限Oracle的功能。 在这种特殊情况下,它不是太糟糕,因为提示不应该改变查询语义。

问题2 :我不知道理论上的最大批量大小,无论如何我建议选择一个“好的”通用初始值(我倾向于选择75,任何介于50和100之间的东西),并通过分析您的特定值来优化这个值用例。 通常,您的初始值将足够好。

Question 1: The main disadvantage I can think of is that you are relying in a Oracle-only feature. In this particular case it is not too bad as that hint should not change query semantics.

Question 2: I don't know about theoretical maximum batch sizes, and anyway I recommend selecting a "good" generic initial value (I tend to choose 75, anything between 50 and 100 willd do), and refine this value by profiling your particular use case. Very often your initial value will be good enough as is.

更多推荐

本文发布于:2023-08-07 17:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465272.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:提示   jdbc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!