我正在執行兩個select查詢。第一個選擇查詢的結果用於獲取第二個選擇查詢的結果。 例 查詢1 =「選擇名稱,使用accountNumber從表1中」 查詢2 =「從表2,其中欄3 =使用accountNumber我們從選擇QUERY1有選擇budget_column1,budget_column2;在select語句上實現批處理
我試圖優化我的代碼。在這種情況下如何實現已準備好的Statement語句addbatch我一直在搜索,但大多數例子顯示的不是select語句中的insert,update,delete語句
java.sql.ResultSet上沒有'addBatch'方法。你在想'PreparedStatement.addBatch'和相應的'executeBatch'嗎? http://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html#addBatch-- http://docs.oracle.com/javase/8/docs/api/java/sql /Statement.html#executeBatch-- –