<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic java resultset in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/java-resultset/m-p/4434158#M682603</link>
    <description>Hi there&lt;BR /&gt;&lt;BR /&gt;I have a strange problem with my Java app.&lt;BR /&gt;I'm testing if username and password is correct   and retrieve 1 or 0.&lt;BR /&gt;But when I test with if (a == "1") then I get negative response as if the value stored in 'a' doesn't match.&lt;BR /&gt;I debugged the application but debugger shows a = "1" so I'm completely stupefied by this.&lt;BR /&gt;Please help.&lt;BR /&gt;&lt;BR /&gt;===============================================&lt;BR /&gt;&lt;BR /&gt;Statement select = c.createStatement();&lt;BR /&gt;ResultSet result = select.executeQuery("select count(*) from system_user where nm = '"&lt;BR /&gt;       + username + "' and pwd = '" + password + "'");&lt;BR /&gt;&lt;BR /&gt;   &lt;BR /&gt;if (result != null) {&lt;BR /&gt;    System.out.println("result !null");&lt;BR /&gt;while (result.next()) {&lt;BR /&gt;a = result.getString(1);&lt;BR /&gt;     System.out.println(a);&lt;BR /&gt;     &lt;BR /&gt;     if (a == "1"){&lt;BR /&gt;      System.out.println(result.getString(1) + "Access granted");&lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   if (a == "1"){&lt;BR /&gt;    System.out.println("Access granted !!!");&lt;BR /&gt;    &lt;BR /&gt;   }else{&lt;BR /&gt;    System.out.println("User " + username + " does not exists in the databse!!!");&lt;BR /&gt;   }&lt;BR /&gt;   &lt;BR /&gt;   result.close();</description>
    <pubDate>Sat, 06 Jun 2009 02:13:20 GMT</pubDate>
    <dc:creator>Piotr Kirklewski</dc:creator>
    <dc:date>2009-06-06T02:13:20Z</dc:date>
    <item>
      <title>java resultset</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-resultset/m-p/4434158#M682603</link>
      <description>Hi there&lt;BR /&gt;&lt;BR /&gt;I have a strange problem with my Java app.&lt;BR /&gt;I'm testing if username and password is correct   and retrieve 1 or 0.&lt;BR /&gt;But when I test with if (a == "1") then I get negative response as if the value stored in 'a' doesn't match.&lt;BR /&gt;I debugged the application but debugger shows a = "1" so I'm completely stupefied by this.&lt;BR /&gt;Please help.&lt;BR /&gt;&lt;BR /&gt;===============================================&lt;BR /&gt;&lt;BR /&gt;Statement select = c.createStatement();&lt;BR /&gt;ResultSet result = select.executeQuery("select count(*) from system_user where nm = '"&lt;BR /&gt;       + username + "' and pwd = '" + password + "'");&lt;BR /&gt;&lt;BR /&gt;   &lt;BR /&gt;if (result != null) {&lt;BR /&gt;    System.out.println("result !null");&lt;BR /&gt;while (result.next()) {&lt;BR /&gt;a = result.getString(1);&lt;BR /&gt;     System.out.println(a);&lt;BR /&gt;     &lt;BR /&gt;     if (a == "1"){&lt;BR /&gt;      System.out.println(result.getString(1) + "Access granted");&lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   if (a == "1"){&lt;BR /&gt;    System.out.println("Access granted !!!");&lt;BR /&gt;    &lt;BR /&gt;   }else{&lt;BR /&gt;    System.out.println("User " + username + " does not exists in the databse!!!");&lt;BR /&gt;   }&lt;BR /&gt;   &lt;BR /&gt;   result.close();</description>
      <pubDate>Sat, 06 Jun 2009 02:13:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-resultset/m-p/4434158#M682603</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2009-06-06T02:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: java resultset</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-resultset/m-p/4434159#M682604</link>
      <description>Any embedded nulls?  What is the length?&lt;BR /&gt;What version of Java?</description>
      <pubDate>Sat, 06 Jun 2009 08:05:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-resultset/m-p/4434159#M682604</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-06-06T08:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: java resultset</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-resultset/m-p/4434160#M682605</link>
      <description>Nothing that I know of.&lt;BR /&gt;&lt;BR /&gt;java version "1.6.0_14"</description>
      <pubDate>Sat, 06 Jun 2009 17:19:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-resultset/m-p/4434160#M682605</guid>
      <dc:creator>Piotr Kirklewski</dc:creator>
      <dc:date>2009-06-06T17:19:03Z</dc:date>
    </item>
  </channel>
</rss>

