提交 978f142f authored 作者: dyorgio's avatar dyorgio

Corrected new trigger view with generated keys unit test.

上级 1b70401a
...@@ -337,14 +337,13 @@ public class TestTriggersConstraints extends TestBase implements Trigger { ...@@ -337,14 +337,13 @@ public class TestTriggersConstraints extends TestBase implements Trigger {
public void init(Connection conn, String schemaName, public void init(Connection conn, String schemaName,
String triggerName, String tableName, boolean before, int type) String triggerName, String tableName, boolean before, int type)
throws SQLException { throws SQLException {
prepInsert = conn.prepareStatement("insert into test values(?)", Statement.RETURN_GENERATED_KEYS); prepInsert = conn.prepareStatement("insert into test values()", Statement.RETURN_GENERATED_KEYS);
} }
@Override @Override
public void fire(Connection conn, Object[] oldRow, Object[] newRow) public void fire(Connection conn, Object[] oldRow, Object[] newRow)
throws SQLException { throws SQLException {
if (newRow != null) { if (newRow != null) {
prepInsert.setInt(1, (Integer) newRow[0]);
prepInsert.execute(); prepInsert.execute();
ResultSet rs = prepInsert.getGeneratedKeys(); ResultSet rs = prepInsert.getGeneratedKeys();
if (rs.next()) { if (rs.next()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论