use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class BatchExecutionWithNullTest method testSetup.
@BeforeEach
public void testSetup() throws TestAbortedException, Exception {
assumeTrue(13 <= new DBConnection(connectionString).getServerVersion(), "Aborting test case as SQL Server version is not compatible with Always encrypted ");
connection = DriverManager.getConnection(connectionString);
SQLServerStatement stmt = (SQLServerStatement) connection.createStatement();
Utils.dropTableIfExists("esimple", stmt);
String sql1 = "create table esimple (id integer not null, name varchar(255), constraint pk_esimple primary key (id))";
stmt.execute(sql1);
stmt.close();
}
use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class BatchExecutionTest method testSetup.
@BeforeAll
public static void testSetup() throws TestAbortedException, Exception {
assumeTrue(13 <= new DBConnection(connectionString).getServerVersion(), "Aborting test case as SQL Server version is not compatible with Always encrypted ");
connection = DriverManager.getConnection(connectionString + ";columnEncryptionSetting=Enabled;");
stmt = (SQLServerStatement) connection.createStatement();
dropTable();
createTable();
}
use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class MergeTest method runTest.
/**
* Merge test
*
* @throws Exception
*/
@Test
@DisplayName("Merge Test")
public void runTest() throws Exception {
try (DBConnection conn = new DBConnection(connectionString)) {
if (conn.getServerVersion() >= 10) {
try (DBStatement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)) {
stmt.executeUpdate(setupTables);
stmt.executeUpdate(mergeCmd2);
int updateCount = stmt.getUpdateCount();
assertEquals(updateCount, 3, "Received the wrong update count!");
}
}
}
}
Aggregations