Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public static void main(String[] args) throws SQLException {
  2. String sku = "1";
  3. String[] cross = { "0514", "0414", "0314", "0214", "0114", "1213", "1113", "1013", "0913", "0813", "0713", "0613" };
  4. String sqlString = "Insert into dbo.Inventory_Metrics (sku, cross) values(?,?)";
  5. Connection conn = DriverManager.getConnection(getPostgresConnUrl());
  6. PreparedStatement ps = conn.prepareStatement(sqlString);
  7. ps.setObject(1, sku);
  8. ps.setObject(2, cross, java.sql.Types.VARCHAR, cross.length);
  9.  
  10. //Throws an error
  11. int status = ps.executeUpdate();
  12. ps.close();
  13. System.out.print(status);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement