我是 Postgres 的新手。我正在尝试使用 java / postgres jdbc 执行以下代码(适用于 MySQL):
for (int i = 0; i < arr.size(); i++)
{
dtoIdent ident = arr.get(i);
stIns.setLong(1, idInterface);
stIns.setString(2, tipo);
try { stIns.executeUpdate(); }
catch (SQLException sqe)
{
stUpd.setString(1, ident.getTipo());
stUpd.executeUpdate();
}
}
连接在 autcommit = false 中。“stIns”和“stUpd”是“PreparedStatements”。
我得到一个25P02。
可以用 Postgres 做到这一点吗?任何解决方法?
非常感谢,
琼。