java.sql.SQLException:对空结果集的非法操作

时间:2013-11-13 18:17:27

标签: java sql

public DialogTambah(JFrame parent, String ACTION, String NAMA) throws Exception {

    super((Frame)null,"" , true);        
    initComponents();       

    AKSI_SELANJUTNYA = ACTION;
    sId = "";
    sUserid = "";
    sPwd = "";
    sNama = "";
    sPhoneNo = "";
    sAddress = "";
    sEmail = "";
    sCrnumber = "";
    tgl="";
    if (AKSI_SELANJUTNYA == "Form Ubah") {

        try {
            Statement Update_st = DBConn.conn.createStatement();
            String SQLEdit = "select * from content where name = '" + NAMA + "' ";
            ResultSet rs = Update_st.executeQuery(SQLEdit);
            rs.next();

java.sql.SQLException:对空结果集的非法操作。

myqstn为什么总是得到null结果?我检查过没有错误。

1 个答案:

答案 0 :(得分:0)

我猜"select * from content where name = '" + NAMA + "' ";没有返回行....

异常发生在哪一行?