簡記
連接SAP HANA數據庫時報了如下錯誤:
ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.dao.PermissionDeniedDataAccessException: ConnectionCallback;
SAP DBTech JDBC: [258]: insufficient privilege: Detailed info for this error can be found with guid '48CF4AA51275224091C2D2066EEFBEFA';
nested exception is com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [258]: insufficient privilege: Detailed info for this error can be found with guid '48CF4AA51275224091C2D2066EEFBEFA'
這個錯誤在SAP官網上只說有個存儲過程可供調用,可以查詢SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS
以此錯誤為例,可使用以下方式查看問題出現的原因:(注意替換guid)
CALL SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS ('48CF4AA51275224091C2D2066EEFBEFA', ?)
我這邊程序的提示如下,錯誤原因是設置了兩個不同的用戶名,我們的項目在啟動參數也設置了schema的名稱,忘記改了……
其他情況需要為當前用戶授予schema的訪問權限即可。