<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Find Answers For ... - Recent questions tagged rs.getlong</title>
<link>https://find4answers.com/tag/rs.getlong</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to know if a field is null or zero, since resultset.getLong() or getInt() method always returns zero</title>
<link>https://find4answers.com/351/field-since-resultset-getlong-getint-method-always-returns</link>
<description>&lt;p&gt;
	I have a field called site_visitors in a table whose data type is number.&lt;/p&gt;
&lt;p&gt;
	When i try to retrieve using below query, it returns zero though the field is empty.&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
		Long siteVisitors=rs.getLong(&quot;site_visitors&quot;);&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	if I print,&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
		System.out.println(&quot;siteVisitors:&quot;+siteVisitors)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
	Outputs always 0.&lt;/p&gt;
&lt;p&gt;
	My question, how to know if siteVisitors is empty or zero in table ?&lt;/p&gt;</description>
<category>Java/J2EE</category>
<guid isPermaLink="true">https://find4answers.com/351/field-since-resultset-getlong-getint-method-always-returns</guid>
<pubDate>Wed, 07 Aug 2013 06:50:30 +0000</pubDate>
</item>
</channel>
</rss>