{"id":63,"date":"2013-06-28T12:14:43","date_gmt":"2013-06-28T12:14:43","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=63"},"modified":"2013-06-28T12:15:14","modified_gmt":"2013-06-28T12:15:14","slug":"how-to-get-number-of-rows-returned-by-resultset-java","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/how-to-get-number-of-rows-returned-by-resultset-java\/","title":{"rendered":"How to get number of rows returned by resultset java"},"content":{"rendered":"<p><strong>Function that Returns No of Rows in ResultSet<\/strong><\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic int getRows(ResultSet res)\r\n{\r\n  int totalRows = 0;\r\n\r\n  try\r\n  {\r\n     res.last();\r\n     totalRows = res.getRow();\r\n     res.beforeFirst();\r\n  }\r\n  catch(Exception ex)  \r\n  {\r\n     return 0;\r\n  }\r\n  \r\n  return totalRows ;    \r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Function that Returns No of Rows in ResultSet public int getRows(ResultSet res) { int totalRows = 0; try { res.last(); totalRows = res.getRow(); res.beforeFirst(); } catch(Exception ex) { return 0; } return totalRows ; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=63"}],"version-history":[{"count":2,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/63\/revisions\/65"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}