diff --git a/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerDriverTest.java b/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerDriverTest.java index 2d2fee89d..e3601437c 100644 --- a/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerDriverTest.java +++ b/src/test/java/com/microsoft/sqlserver/jdbc/SQLServerDriverTest.java @@ -211,6 +211,24 @@ public void testApplicationName() throws SQLException { } } + /** + * test application name by executing select app_name() + * + * @throws SQLException + */ + @Test + public void testApplicationNameUsingApp_Name() throws SQLException { + try (Connection conn = DriverManager.getConnection(connectionString); + Statement stmt = conn.createStatement(); + ResultSet rs = stmt.executeQuery("SELECT app_name()")) { + if (rs.next()) { + assertEquals(SQLServerDriver.constructedAppName, rs.getString(1)); + } + } catch (SQLException e) { + fail(e.getMessage()); + } + } + /** * test application name when system properties are empty *