use of com.microsoft.sqlserver.testframework.DBResultSetTypes in project mssql-jdbc by Microsoft.
the class bvtTest method testStmtSserverCursorForwardOnly.
/**
* Create a statement TYPE_SS_SEVER_CURSOR_FORWARD_ONLY, CONCUR_READ_ONLY, executeQuery verify cursor by using next and verify data
*
* @throws SQLException
*/
@Test
public void testStmtSserverCursorForwardOnly() throws SQLException {
DBResultSetTypes rsType = DBResultSetTypes.TYPE_FORWARD_ONLY_CONCUR_READ_ONLY;
String query = "SELECT * FROM " + table1.getEscapedTableName();
try (DBConnection conn = new DBConnection(connectionString);
DBStatement stmt = conn.createStatement(rsType.resultsetCursor, rsType.resultSetConcurrency);
DBResultSet rs = stmt.executeQuery(query)) {
// Verify resultset behavior
rs.next();
rs.verify(table1);
}
}
Aggregations