JDBC - Resultset为false

时间:2013-03-04 15:34:03

标签: sql oracle jdbc

我有以下问题。 我正在使用JDBC并进行查询。但是qry不起作用。如果我打印出rs.next(),则返回false。

同样的qry在SQL-Developer本身上工作,而不是在JDBC中。 QRY:

ResultSet rs = stmt.executeQuery("select account_id, oper_type, new_value from action where account_id = 1");
        //ResultSet rsAccount = stmt.executeQuery("select account_id from accounts");
        System.out.println("Accounts Update");
        System.out.println(rs.next());
        if(rs.next() == true){
            System.out.println("Not null");
        }

1 个答案:

答案 0 :(得分:1)

好的,我“解决了”它。问题是我的项目导师忘了添加提交;在sql文件的末尾