From a1b6492355139457e27b98a4d0a3d2c05bce007e Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Sat, 2 Nov 2024 00:22:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81=E4=B8=AD?= =?UTF-8?q?=E6=BC=94=E7=A4=BA=E5=A6=82=E4=BD=95=E8=8E=B7=E5=8F=96=20id?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/xyz/zhouxy/jdbc/test/SimpleJdbcTemplateTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/xyz/zhouxy/jdbc/test/SimpleJdbcTemplateTests.java b/src/test/java/xyz/zhouxy/jdbc/test/SimpleJdbcTemplateTests.java index 1658586..aa1a1a9 100644 --- a/src/test/java/xyz/zhouxy/jdbc/test/SimpleJdbcTemplateTests.java +++ b/src/test/java/xyz/zhouxy/jdbc/test/SimpleJdbcTemplateTests.java @@ -122,6 +122,12 @@ class SimpleJdbcTemplateTests { assertTrue(key.containsKey("create_time")); assertInstanceOf(Date.class, key.get("create_time")); } + List ids = jdbcTemplate.update( + "INSERT INTO sys_account(username, account_status, created_by) VALUES (?, ?, ?), (?, ?, ?)", + buildParams("zhouxy21", "2", 123L, "code22", '2', 456L), + (rs, rowNumber) -> rs.getObject("id", Long.class)); + log.info("ids: {}", ids); + assertEquals(2, ids.size()); } @Test