Using BI connector inside the java program

hi there,
Is there a way to use BI connector inside a java program to write SQL queries… if yes can you give me please the steps to do that .i followed this tutorial: https://docs.mongodb.com/bi-connector/master/reference/auth-plugin-jdbc but i keep getting an error saying : the server only accepts ssl connections