use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class lobsTest method createTable.
private static DBTable createTable(DBTable table, String[] types, boolean populateTable) throws Exception {
DBStatement stmt = new DBConnection(connectionString).createStatement();
table = new DBTable(false);
for (String type1 : types) {
SqlType type = Utils.find(type1);
table.addColumn(type);
}
stmt.createTable(table);
if (populateTable) {
stmt.populateTable(table);
}
stmt.close();
return table;
}
use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class BulkCopyCSVTest method setUpConnection.
/**
* Create connection, statement and generate path of resource file
*/
@BeforeAll
static void setUpConnection() {
con = new DBConnection(connectionString);
stmt = con.createStatement();
filePath = Utils.getCurrentClassPath();
}
use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class WrapperTest method isKatmaiServer.
private static boolean isKatmaiServer() throws Exception {
DBConnection conn = new DBConnection(connectionString);
double version = conn.getServerVersion();
conn.close();
return ((version >= 10.0) ? true : false);
}
use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class BulkCopyTestUtil method performBulkCopy.
/**
* @param bulkWrapper
* @param srcData
* @param dstTable
*/
static void performBulkCopy(BulkCopyTestWrapper bulkWrapper, ISQLServerBulkRecord srcData, DBTable dstTable) {
try (DBConnection con = new DBConnection(bulkWrapper.getConnectionString());
DBStatement stmt = con.createStatement();
SQLServerBulkCopy bc = new SQLServerBulkCopy(bulkWrapper.getConnectionString())) {
bc.setDestinationTableName(dstTable.getEscapedTableName());
bc.writeToServer(srcData);
validateValues(con, srcData, dstTable);
} catch (Exception e) {
fail(e.getMessage());
}
}
use of com.microsoft.sqlserver.testframework.DBConnection in project mssql-jdbc by Microsoft.
the class bvtTestSetup method init.
@BeforeAll
public static void init() throws SQLException {
try (DBConnection conn = new DBConnection(connectionString);
DBStatement stmt = conn.createStatement()) {
// create tables
table1 = new DBTable(true);
stmt.createTable(table1);
stmt.populateTable(table1);
table2 = new DBTable(true);
stmt.createTable(table2);
stmt.populateTable(table2);
}
}
Aggregations