Search in sources :

Example 1 with SQLServerPreparedStatement42

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

the class Wrapper42Test method PreparedSatement42Test.

/**
 * Tests creation of SQLServerPreparedSatement42 object
 *
 * @throws SQLException
 */
@Test
public void PreparedSatement42Test() throws SQLException {
    String sql = "SELECT SUSER_SNAME()";
    PreparedStatement pstmt = connection.prepareStatement(sql);
    if (1.8d <= javaVersion && 4 == major && 2 == minor) {
        assertTrue(pstmt instanceof SQLServerPreparedStatement42);
    } else {
        assertTrue(pstmt instanceof SQLServerPreparedStatement);
    }
}
Also used : SQLServerPreparedStatement42(com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement42) SQLServerPreparedStatement(com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement) PreparedStatement(java.sql.PreparedStatement) SQLServerPreparedStatement(com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement) Test(org.junit.jupiter.api.Test) AbstractTest(com.microsoft.sqlserver.testframework.AbstractTest)

Aggregations

SQLServerPreparedStatement (com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement)1 SQLServerPreparedStatement42 (com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement42)1 AbstractTest (com.microsoft.sqlserver.testframework.AbstractTest)1 PreparedStatement (java.sql.PreparedStatement)1 Test (org.junit.jupiter.api.Test)1