title: PostgreSQL & JDBC: INSERT INTO with RETURNING returns empty result set
body: <p>I have an insert statement with a returning value. The problem is, only the INSERT INTO part works, but returns nothing. I tried with table attributes and constant values too. I am using <em>org.postgresql:postgresql:9.3-1101-jdbc41</em> driver.</p>
  
  <p>Is there any solutionsto make this query working properly?</p>
  
  <pre><code>private Blitz blitzToDB(Blitz curr)
  {
      try
      {
          SolarPosition position = new SolarPosition(System.currentTimeMillis(),curr.BlitzLat,curr.BlitzLon);
          PreparedStatement blitz_insertion = mPostgresConn.prepareCall("INSERT INTO blitzv2_blitzes (blitz_lat, blitz_lon, blitz_mapx, blitz_mapy, blitz_map, blitz_country, blitz_region, blitz_subregion, blitz_settlem, blitz_settlemtype, blitz_concattype, blitz_sunelev, blitz_str) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) RETURNING '0'");
          blitz_insertion.setDouble(1, curr.BlitzLat);
          blitz_insertion.setDouble(2, curr.BlitzLon);
          blitz_insertion.setDouble(3,0);
          blitz_insertion.setDouble(4, 0);
          blitz_insertion.setString(5, "LIVE");
          blitz_insertion.setString(6,curr.BlitzCountry);
          blitz_insertion.setString(7,curr.BlitzRegion);
          blitz_insertion.setString(8,curr.BlitzSubregion);
          blitz_insertion.setString(9,curr.BlitzSettlem);
          blitz_insertion.setString(10,curr.BlitzSettlemType);
          blitz_insertion.setString(11,"NONE");
          blitz_insertion.setDouble(12,curr.SunElevation);
          blitz_insertion.setString(13,curr.BlitzStreet);
          ResultSet rs = blitz_insertion.executeQuery();
          if(rs.next())
          {
              System.out.println(rs.getInt(1));
             // curr.BlitzID = rs.getLong(1);
          }
          else
          {
              System.out.println(":(");
          }
          return curr;
      }
      catch (Exception ex)
      {
          ex.printStackTrace();
          ErrorLog.pushError(ErrorLog.ErrorKinds.BlitzSqlError,ex);
          curr.BlitzID = 0L;
          return curr;
      }
  
  }
  </code></pre>