added test for parameter with braces
@@ -73,4 +73,28 @@ public class ParameterMetaDataTest extends AbstractTest {
"SQLServerException should not be wrapped by another SQLServerException.");
}
}
+
+ /**
+ * Test ParameterMetaData when parameter name contains braces
+ *
+ * @throws SQLException
+ */
+ @Test
+ public void testNameWithBraces() throws SQLException {
+ try (Connection con = DriverManager.getConnection(connectionString); Statement stmt = con.createStatement()) {
+
+ stmt.executeUpdate("create table " + tableName + " ([c1_varchar(max)] varchar(max))");
+ try {
+ String query = "insert into " + tableName + " ([c1_varchar(max)]) values (?)";
+
+ try (PreparedStatement pstmt = con.prepareStatement(query)) {
+ pstmt.getParameterMetaData();
+ }
+ }
+ finally {
+ Utils.dropTableIfExists(tableName, stmt);
+ }
+
+ }
+ }
}
