問題描述
我正在將 JTOpen JDBC 驅(qū)動程序用于 DB2 通用數(shù)據(jù)庫.除了簡單的語句之外,我對 SQL 的經(jīng)驗很少.
I'm using the JTOpen JDBC driver for a DB2 Universal database. I have very little experience with SQL beyond simple statements.
從 這個問題,我看到嘗試在事務期間在非日志表中插入/更新行"時拋出我遇到的錯誤(SQL7008)(釋義).
From this question, I see that the error I'm getting (SQL7008) is thrown when trying to "insert/update rows in a non-journaled table during a transaction" (paraphrased).
根據(jù)項目負責人的說法,我們的 DB 沒有日志記錄,并且不會很快出現(xiàn)(不要問我為什么,我不是 DBA).但是,我正在開發(fā)一個項目,其中幾乎需要一次性commit
所有內(nèi)容(而不是每次調(diào)用執(zhí)行時都自動提交)(不是完全需要,但它會解決未來會有很多問題).
According to the project lead, our DB is not journaled and won't be any time soon (don't ask me why, I'm not the DBA). However, I'm working on a project where being able to commit
everything in one go (rather than AutoCommit-ing each time an execute is called) is nearly necessary (not totally required, but it would solve a lot of issues down the road).
有沒有辦法在不啟用 Journalling 的情況下解決錯誤 SQL7008?
Is there any way to work around erorr SQL7008 without enabling Journalling?
推薦答案
在不啟用日志的情況下解決此問題的唯一方法是在連接字符串中禁用 事務隔離,如下所示:
The only way to work around it without enabling journaling is to disable transaction isolation in your connection string as follows:
jdbc:as400://systemname;naming=sql;errors=full;transaction isolation=none;date format=iso
可以在 IBM Toolbox for Java JDBC 屬性 文檔.
這篇關(guān)于SQL7008 錯誤 - 解決方法?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!