1、這個問題主要和返回字段是否和實體類javabean中的字段是否一致導致的問題。
解決方案:
sql語句 : select account_id as "accountId" account_name as "accountName" from account_t 數據庫的字段 account_id account_name java的實體類:accountId accountName
2、是否手動的修改了oracle數據庫中的記錄,默認查詢時是走緩存的,如果手動修改數據庫中的數據,很可能造成這種情況。
3、使用update/delete/insert語句時,必須使用事物commit。
jdbc api使用事物的方式:
try{ //Assume a valid connection object conn conn.setAutoCommit(false); Statement stmt = conn.createStatement(); String SQL = "INSERT INTO Employees " + "VALUES (106, 20, 'Rita', 'Tez')"; stmt.executeUpdate(SQL); //Submit a malformed SQL statement that breaks String SQL = "INSERTED IN Employees " + "VALUES (107, 22, 'Sita', 'Singh')"; stmt.executeUpdate(SQL); // If there is no error. conn.commit(); }catch(SQLException se){ // If there is any error. conn.rollback(); }