changeset 362:2f72b89e1686

Improve test. Add a SELECT COUNT(*) query after the execution of the batched inserts to verify the expected nr of rows have been inserted.
author Martin van Dinther <martin.van.dinther@monetdbsolutions.com>
date Wed, 09 Sep 2020 17:35:25 +0200 (2020-09-09)
parents 253363a2ae28
children 34ce6e1b1be8
files tests/Test_PSlargebatchval.java
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/Test_PSlargebatchval.java
+++ b/tests/Test_PSlargebatchval.java
@@ -38,6 +38,7 @@ public class Test_PSlargebatchval {
 			pstmt.setDouble(3, 1.0);
 			pstmt.addBatch();
 			pstmt.executeBatch();
+			System.out.println("1. inserted 1 large string");
 
 			/* test issue reported at https://www.monetdb.org/bugzilla/show_bug.cgi?id=3470 */
 			pstmt.setLong(1, -2L);
@@ -45,6 +46,7 @@ public class Test_PSlargebatchval {
 			pstmt.setDouble(3, -2.0);
 			pstmt.addBatch();
 			pstmt.executeBatch();
+			System.out.println("2. inserted 1 large clob via StringReader() object");
 
 			Clob myClob = con.createClob();
 			myClob.setString(1L, largeStr);
@@ -54,9 +56,15 @@ public class Test_PSlargebatchval {
 			pstmt.setDouble(3, 12345678901.98765);
 			pstmt.addBatch();
 			pstmt.executeBatch();
+			System.out.println("3. inserted 1 large clob via createClob() object");
 
 			pstmt.close();
 
+			ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM x");
+			if (rs.next())
+				System.out.println(rs.getInt(1) + " rows inserted.");
+			rs.close();
+
 			stmt.execute("DROP TABLE x");
 			stmt.close();
 		} catch (SQLException e) {