Search in sources :

Example 1 with SQLServerResultSet42

use of com.microsoft.sqlserver.jdbc.SQLServerResultSet42 in project mssql-jdbc by Microsoft.

the class ResultSetWrapper42Test method SQLServerResultSet42Test.

/**
 * Tests creation of SQLServerResultSet42 object
 *
 * @throws SQLException
 */
@Test
public void SQLServerResultSet42Test() throws SQLException {
    String sql = "SELECT SUSER_SNAME()";
    ResultSet rs = null;
    try {
        rs = connection.createStatement().executeQuery(sql);
        if (1.8d <= javaVersion && 4 == major && 2 == minor) {
            assertTrue(rs instanceof SQLServerResultSet42);
        } else {
            assertTrue(rs instanceof SQLServerResultSet);
        }
    } finally {
        if (null != rs) {
            rs.close();
        }
    }
}
Also used : SQLServerResultSet(com.microsoft.sqlserver.jdbc.SQLServerResultSet) SQLServerResultSet42(com.microsoft.sqlserver.jdbc.SQLServerResultSet42) SQLServerResultSet(com.microsoft.sqlserver.jdbc.SQLServerResultSet) ResultSet(java.sql.ResultSet) Test(org.junit.jupiter.api.Test) AbstractTest(com.microsoft.sqlserver.testframework.AbstractTest)

Aggregations

SQLServerResultSet (com.microsoft.sqlserver.jdbc.SQLServerResultSet)1 SQLServerResultSet42 (com.microsoft.sqlserver.jdbc.SQLServerResultSet42)1 AbstractTest (com.microsoft.sqlserver.testframework.AbstractTest)1 ResultSet (java.sql.ResultSet)1 Test (org.junit.jupiter.api.Test)1