What could be more better approch for this problem??
Mahajan Bhupendra
Ranch Hand
Joined: Dec 01, 2000
Posts: 118
posted
0
Hi, in servlet i m using one bean which gets something from databse.i m using ms access as backend. i am having a field "question_no" with data type Number when i am trying to get the value with getObject() method of ResultSet i am getting SQLException saying that : No Data Found although i m able to get other data which is in terms of string i m geeting the data using.. if(row.getObject("question_no")!=null) questionNo=((Integer)row.getObject("question_no")).intValue(); Since i want to check for null value also i don't eant to use getInt() method.. What could be wrong?? Surprisingly i found very bad solution for this.. Object o=rs.getObject("answer_correct"); if(o!=null){ int a=((Integer)o).intValue(); System.out.println(a); } but i think this is not the correct way of doing this.. could anybody suggest me some better way Surpisingly on other fields i m using getString() and they are working fine Thanks in advance.. Bhupendra
[This message has been edited by Mahajan Bhupendra (edited October 11, 2001).]
Originally posted by Mahajan Bhupendra: Hi, in servlet i m using one bean which gets something from databse.i m using ms access as backend. i am having a field "question_no" with data type Number when i am trying to get the value with getObject() method of ResultSet i am getting SQLException saying that : No Data Found although i m able to get other data which is in terms of string i m geeting the data using.. if(row.getObject("question_no")!=null) questionNo=((Integer)row.getObject("question_no")).intValue(); Since i want to check for null value also i don't eant to use getInt() method.. What could be wrong?? Surprisingly i found very bad solution for this.. Object o=rs.getObject("answer_correct"); if(o!=null){ int a=((Integer)o).intValue(); System.out.println(a); } but i think this is not the correct way of doing this.. could anybody suggest me some better way Surpisingly on other fields i m using getString() and they are working fine Thanks in advance.. Bhupendra [This message has been edited by Mahajan Bhupendra (edited October 11, 2001).]
homeboy
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: What could be more better approch for this problem??