title: postgresql + Java
body: <p><strong>I am trying to execute this sql code in java but after it executes, I need to set it to a value im trying to enter into a table.</strong></p>
  
  <pre><code>st = "INSERT INTO master_st4(unix_timestamp, hrap_xy, rain) values(?, ?, ?)";
  state = connection.prepareStatement(st);
  state.setInt(1, "select extract (epoch from '2014-03-01 06:00:00 UTC':: timestamp with time zone)");
  state.setInt(2, in);
  state.setDouble(3, arrBDS);                    
  state.executeUpdate();
  </code></pre>
  
  <p><strong>I know this returns something else than an integer, but I need a integer to pass into the first of the three set statements. unix_timestamp is an integer, hrap_xy is an integer, rain is a real number so double.</strong></p>
  
  <p><strong>Here is the error message:</strong></p>
  
  <p><em>Exception in thread "main" java.lang.NumberFormatException: For input string: "select extract (epoch from '2014-03-01 06:00:00 UTC':: timestamp with time zone)"
      at java.lang.NumberFormatException.forInputString(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at JgribDEX.main(JgribDEX.java:110)</em></p>