SQLException: Exhausted Resultset

前端 未结 3 2261
刺人心
刺人心 2020-12-11 22:40

I have a problem with my JDBC code. This is the relevant code:

/** method for checking password into the Oracle database */
public String CheckUserDB(String          


        
相关标签:
3条回答
  • 2020-12-11 22:52

    use the varchar data type instead of char in the oracle database.

    if you use char then actual size with blank space of database is compared with query parameter

    and query doesnt get exucuted that is result gets false.

    So use the varchar datatype in oracle database.

    0 讨论(0)
  • 2020-12-11 23:08
    result.next();
    
    storedPassword = result.getString("passwd"); 
    

    You are not checking the return value of next. If you have no rows you get into trouble...

    if(result.next()){
       storedPassword = result.getString("passwd");
    }
    
    0 讨论(0)
  • 2020-12-11 23:14

    The problem might not be with the code but instead could be the database. Double check that the TABLE IS NOT EMPTY. You get this error if the table is empty. Keep in mind that databases like Oracle require a commit after all your insert, update, alter statements .Your changes might not be visible outside the database till you run a commit over the your db, I was having this problem for quite a long time. I kept on checking the table with select statement but the problem with my oracle db was that I had not issued a commit over my db.

    0 讨论(0)
提交回复
热议问题