title: com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data type is not supported
body: <p>I want to create simple Java code which displays MSSQL server version:</p>
  
  <pre><code>public void testMSSQLVersion() throws Exception
      {
          System.out.println("\nTesting SQL query for MSSQL version\n");
  
          try
          {
              // Load the SQLServerDriver class, build the
              // connection string, and get a connection
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              String connectionUrl = "jdbc:sqlserver://localhost:1433;"
                  + "database=master;"
                  + "user=admin;"
                  + "password=dss!Q;";
              Connection con = DriverManager.getConnection(connectionUrl);
              System.out.println("Connected.");
  
              // Create and execute an SQL statement that returns some data.
              String SQL = "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')";
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery(SQL);
  
              // Iterate through the data in the result set and display it.
              while (rs.next())
              {
                  System.out.println(rs.getString(1));
              }
  
          }
          catch (Exception e)
          {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>But when I run the code I get this error:</p>
  
  <pre><code>com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data type is not supported.
      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
      at com.microsoft.sqlserver.jdbc.TypeInfo$Builder$16.apply(dtv.java:1996)
      at com.microsoft.sqlserver.jdbc.TypeInfo$Builder.build(dtv.java:2158)
  </code></pre>
  
  <p>Is there any solution for this problem?</p>