title: Retrieve value as character from NCR values coming from Database
body: <p>I'm facing issue to retrieve value as character from resultset. The result set is showing values in NCR format(eg; &amp;#21488 ;&amp;#21271 ;) instead of character (eg: 台北). I don't know how to get the characters from resultSet.</p>
  
  <p>I'm getting value from resultSet</p>
  
  <pre><code>           while (resultSet.next()) {
                            resultSet.getString(1); // this value is coming as NCR / or some other text
                     }
  </code></pre>
  
  <p>I have tried one approach but I have issues with it</p>
  
  <pre><code>public static String ConvertDecimalNCRToString(String hex)
  {
      String myString = hex.replace("&amp;#", "");
      String[] split = myString.split(";");
      StringBuilder sb = new StringBuilder();
  
      for (int i = 0; i &lt; split.length; i++) 
      {
          sb.append((char)Integer.parseInt(split[i]));
      }
      return sb.toString();
  }
  </code></pre>
  
  <p>if my String is " &amp;#21488 ;&amp;#21271 ;" then the program runs fine but the string can contain other values as well apart from NCR value like "stre1234&amp;#21488 ;&amp;#21271 ;" in this case the above approach fails. Could anyone can suggest some good approach to achieve it. I also wants to know if there are other ways through which I can get the character value directly from resultSet instead of NCR values?</p>
  
  <p>Thanks in Advance ..!!</p>