Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. .apply(JdbcIO.<MyData>write()
  2. .withDataSourceConfiguration(JdbcIO.DataSourceConfiguration.create(
  3. "org.postgresql.Driver", "jdbc:postgresql://localhost:5432/postgres")
  4. .withUsername("postgres")
  5. .withPassword("password"))
  6.  
  7. .withStatement("do $$n" +
  8. "begin " +
  9. "perform test_routine(first := ?, second := ?, age := ?) " +
  10. "endn" +
  11. "$$;")
  12. .withPreparedStatementSetter(new JdbcIO.PreparedStatementSetter<MyData>() {
  13. public void setParameters(MyData element, PreparedStatement query)
  14. throws SQLException {
  15. query.setString(1,element.mfirst);
  16. query.setString(2, element.second);
  17. query.setInt(3, element.age);
  18. }
  19. })
  20. );
  21.  
  22. org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement