简体   繁体   English

OJDBC ExecuteUpdate()不返回任何内容

[英]OJDBC ExecuteUpdate() does not return anything

I have a small java application, and i'm trying to execute a insert-select ( insert into table1 (column) select column from table2 ) using oracle jdbc driver, this sql comand inserts around 230k lines, in SQL Developer it runs in 30 minutes, but at java, when i called ExecuteUpdate() the method stuck and does not returns anything, more than 3 hours of execution, and the method remains stuck. 我有一个小型的Java应用程序,我正在尝试使用oracle jdbc驱动程序执行insert-select( insert into table1 (column) select column from table2 ),此sql comand插入约23万行,在SQL Developer中它在30中运行分钟,但是在Java上,当我调用ExecuteUpdate()该方法被卡住,并且不返回任何内容,超过3个小时的执行时间,并且该方法仍然被卡住。

I tried to use execute() but the result was the same. 我尝试使用execute()但结果是相同的。 I tried the drivers ojdbc5, ojdbc6 and ojdbc7, without success. 我尝试了驱动程序ojdbc5,ojdbc6和ojdbc7,但未成功。

I found this question: Java - JDBC executeUpdate() not working but i can't change to weblogic. 我发现了这个问题: Java-JDBC executeUpdate()无法正常工作,但是我无法更改为weblogic。

anyone can help-me? 有人可以帮助我吗?

EDIT: The SQL command is successful executed, when i query this on sql developer, i can see the correct result, but in java application the method remais stuck. 编辑:SQL命令已成功执行,当我在sql Developer上查询此命令时,我可以看到正确的结果,但是在Java应用程序中该方法仍然存在。

It will be easier to understand problem, if i can see your code. 如果我能看到您的代码,将更容易理解问题。 First of all, executeUpdate("some query") function doesn't have return value. 首先, executeUpdate("some query")函数没有返回值。 If i remember, you can assign int result = statement.executeUpdate("query") If you want return values, you can use ResultSet rs = statement.executeQuery("some query") executeUpdate() always stucks while inserting a lot of rows, but 3 hours is not normal. 如果我记得的话,可以分配int result = statement.executeUpdate("query")如果要返回值,可以使用ResultSet rs = statement.executeQuery("some query") executeUpdate()在插入大量行时总是卡住,但3小时不正常。 Please show your code :) 请显示您的代码:)

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

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