use of com.microsoft.sqlserver.jdbc.SQLServerParameterMetaData in project mssql-jdbc by Microsoft.
the class PQImpsTest method testComplexQueryWithMultipleTables.
/**
* test getting parameter count with a complex query with multiple table
*
* @throws SQLException
*/
@Test
public void testComplexQueryWithMultipleTables() throws SQLException {
pstmt = connection.prepareStatement("insert into " + charTable + " (c1) select ? where not exists (select * from " + charTable2 + " where table2c1 = ?)");
try {
SQLServerParameterMetaData pMD = (SQLServerParameterMetaData) pstmt.getParameterMetaData();
int parameterCount = pMD.getParameterCount();
assertTrue(2 == parameterCount, "Parameter Count should be 2.");
} catch (Exception e) {
fail(e.toString());
}
}
Aggregations