title: How to pass BigInteger from java to Postgres?
body: <p>I need to pass a BigInteger argument to SQL query. (on Postgres 9.2)
  I have this code in my DAO:</p>
  
  <pre><code>    public List&lt;PersonInfo&gt; select(String id) {
          BigInteger bigIntId = new BigInteger(id);
          JdbcTemplate select = new JdbcTemplate(dataSource);
          return select
              .query("SELECT * FROM PE.SUPPLIER_INPUT_DATA WHERE ID = ?",
                      new Object[] { bigIntId },
                      new PersonRowMapper());
      }
  </code></pre>
  
  <p>I am getting the following exception:</p>
  
  <pre><code>{"error":"Error invoking getPersonInfoById.[org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; 
  bad SQL grammar [SELECT * FROM PE.SUPPLIER_INPUT_DATA WHERE ID = ?]; 
  nested exception is org.postgresql.util.PSQLException: 
  Can't infer the SQL type to use for an instance of java.math.BigInteger. 
  Use setObject() with an explicit Types value to specify the type to use.]"}
  </code></pre>
  
  <p>The id is of type bigint</p>
  
  <p>Tried to pass plain String - also throws type exception.
  Googled the message in the exception - no relevant result.
  Any ideas? </p>