简体   繁体   English

通过Jdbc调用使用提示-Spring jdbc批处理

[英]Use of Hint with jdbc call -Spring jdbc batch

I have two questions related to Spring jdbc batch insert : if anybody can help me on this 我有两个与Spring jdbc批处理插入相关的问题:如果有人可以帮助我

Question 1: Scenario : The insert statement is : INSERT into EMPLOYEE_TABLE VALUES(....); 问题1:场景:insert语句是: 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 ? 我可以在插入语句中使用提示/*+APPEND_VALUES*/吗?我的意思是在jdbc调用中具有提示是否有任何缺点?

Question 2 : What could be maximum batch size ojdbc6.jar can have ? 问题2:ojdbc6.jar可以具有的最大批处理大小是多少?

Thanks in advance 提前致谢

Question 1 : The main disadvantage I can think of is that you are relying in a Oracle-only feature. 问题1 :我能想到的主要缺点是您依赖于仅Oracle的功能。 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. 问题2 :我不知道理论上的最大批处理大小,无论如何,我建议选择一个“好的”通用初始值(我倾向于选择75,50至100的任意值),并通过分析您的特定值来优化此值用例。 Very often your initial value will be good enough as is. 通常,您的初始值将足够好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM