• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting resultset without record in table

 
Singh Anisha
Ranch Hand
Posts: 100
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
i have written this code of block in work.jsp to check if record exist in DB

function called by myCon



all is well only problem is that even when there is no record in DB, this code is getting resultset object.
Table is completely blank.
I just copied the query and run it from cmd it returned emptyset.
 
Singh Anisha
Ranch Hand
Posts: 100
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the loophole.
As i was not using result.next() to check if it is empty.
resolved now.
 
Tim Cooke
Sheriff
Pie
Posts: 3203
142
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that belongs in a JSP file? Looks very much like Java code to me.
 
Singh Anisha
Ranch Hand
Posts: 100
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code in a class used inside jsp
 
Tim Cooke
Sheriff
Pie
Posts: 3203
142
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the bit of code with the try block in it is in a .java file?

If so then that's ok. If it's in a .jsp file then that's bad, it should be in a .java file.
 
Singh Anisha
Ranch Hand
Posts: 100
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, it is in .java class
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic