Red Hat Bugzilla – Bug 1263183
MSSQL Connection Guided has some error
Last modified: 2015-10-20 08:58:29 EDT
Title: Example Microsoft SQLServer Datasource
Describe the issue:
in Chapter 6.8.7, Example 6.16,
Connection URL and Datasource needs update.
Suggestions for improvement:
That's incorrect. The xa-datasource-class value needs to refer to a class implementing javax.sql.XADataSource, not java.sql.Driver.
If you configure it this way, you will get a java.lang.ClassCastException: com.microsoft.sqlserver.jdbc.SQLServerDriver cannot be cast to javax.sql.XADataSource
Jeonghun Kim: maybe you were confused by the fact that there is no reference to the JDBC driver class. It is not necessary, because it is detected automatically from the META-INF/services/java.sql.Driver file. You don't need to specify the driver class (com.microsoft.sqlserver.jdbc.SQLServerDriver) anywhere.
You also don't actually need to specify the xa-datasource-class element at all if you are planning to create a non-XA data source out of it. And we are talking about example 6.29, which is about a non-XA datasource. In this case, including xa-datasource-class might be confusing. I suggest that we remove the xa-datasource-class completely. But only from "Example 6.29. SQLserver datasource configuration". It has to stay in "Example 6.31. SQLserver XA datasource". And the value is correct there.
In short - what needs to be fixed:
- please remove the <xa-datasource-class> element from "Example 6.29. SQLserver datasource configuration" completely, it is unnecessary and confusing (now also with incorrect value - the previous one was correct)
- leave the <xa-datasource-class> element in "Example 6.31. SQLserver XA datasource" as it is! It's correct there.
Used 6.4.0-39 for verification.
Looks good now, thanks.