title: java.sql.SQLException: Fail to convert to internal representation Exception
body: <p>Please find my below query,</p>
  
  <pre><code>select nvl(max(transaction_id),0) as  transaction_id from exception_details;
  </code></pre>
  
  <p>If I execute the above query through my jdbc code, it is giving me <code>java.sql.SQLException: Fail to convert to internal representation</code> 
  my JDBC code is as follows:</p>
  
  <pre><code>public int fetchColumnVal(String query) throws SQLException, IllegalAccessException, 
      InvocationTargetException, NoSuchMethodException, ClassNotFoundException, InstantiationException {
  
      PreparedStatement pstmt = null;
      Connection con = null;
      try {
          con = getConnection(true);
          pstmt = con.prepareStatement(query);
          ResultSet rs = pstmt.executeQuery();
          rs.next();
          int count=rs.getInt(1);
          return count;
      } finally {
          if (isBatchMode) {
              this.cleanResources(null, pstmt);
          }
          else {
              this.cleanResources(con, pstmt);
          }
      }
  }
  </code></pre>
  
  <p>and the data type for the column transaction_id in the table is NUMBER</p>