WSO2 API Manager BAM SQL Server

时间:2014-08-19 19:20:15

标签: sql-server wso2

我们正在尝试使用SQL Server数据库设置WSO2 API Manager和WSO2 BAM。尝试在API Store中查看BAM仪表板时,我们收到以下错误:

  

错误用法:jag org.wso2.carbon.apimgt.api.APIManagementException:为ProviderAPIUsage调用APIUsageStatisticsClient时出错 - 由以下引起:com.microsoft.sqlserver.jdbc.SQLServerException:关键字' WHERE&#附近的语法不正确39;

跟踪数据库后,我们发现以下查询导致错误:

SELECT CONSUMER_KEY,NAME 
FROM AM_APPLICATION_KEY_MAPPING  
NATURAL JOIN AM_APPLICATION  
NATURAL JOIN AM_SUBSCRIBER WHERE USER_ID = 'admin'

由于SQL Server不支持NATURAL JOIN,有没有办法让API Manager和BAM与SQL Server一起使用?

1 个答案:

答案 0 :(得分:0)

如果要将查询传递给MS SQL Server,则需要使用T-SQL重写此查询,这将是这样的......

SELECT  [TableName].CONSUMER_KEY
        ,[TableName].NAME 
FROM       AM_APPLICATION_KEY_MAPPING  
INNER JOIN AM_APPLICATION  
           ON AM_APPLICATION_KEY_MAPPING.CommonColumn   = AM_APPLICATION.CommonColumn
INNER JOIN AM_SUBSCRIBER   
           ON [One of the Previous Tables].CommonColumn = AM_SUBSCRIBER.CommonColumn
WHERE [TableName].[USER_ID] = 'admin'