I was also having issue connecting I followed this blog.
Please see the blog below:
https://medium.com/@khan.abdulwasey99/step-by-step-process-on-how-to-connect-a-spring-boot-application-to-supabase-f1791e1d2402