Giriş
src/test/resources/container-license-acceptance.txt dosyası yaratılır. Dosyada
mcr.microsoft.com/mssql/server:2017-CU12
veya
mcr.microsoft.com/mssql/server:latest
cümlesi yazar
Örnek
Şöyle yaparız
<dependency> <groupId>org.testcontainers</groupId> <artifactId>mssqlserver</artifactId> <version>1.17.6</version> <scope>test</scope> </dependency> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> <version>11.2.2.jre8</version> <scope>test</scope> </dependency>
Şöyle yaparız
String jdbcUrl = "jdbc:tc:sqlserver:latest:///mydbName"; try (Connection conn = DriverManager.getConnection(jdbcUrl)) { ... }
Şöyle yaparız
String jdbcUrl = "jdbc:tc:sqlserver:2017-CU12:///mydbName"; try (Connection conn = DriverManager.getConnection(jdbcUrl)) { ... }
No comments:
Post a Comment