
If you are working with JDBC and your Database using SSL, then you can simply add ?autoReconnect=true&useSSL=false to the database connection string,
Example:
private static final String MYSQL_JDBC_DRIVER_CLASS = "com.mysql.cj.jdbc.Driver";
private static final String DB_URL = "jdbc:mysql://localhost:3306/myDb?autoReconnect=true&useSSL=false";
private static final String DB_USER = "root";
private static final String DB_USER_PASSWORD = "root123";
Connection connection = DriverManager.getConnection(DB_URL,DB_USER,DB_USER_PASSWORD);
If you want your Database say MySQL to have SSL enabled then follow this document: https://dev.mysql.com/doc/refman/8.0/en/creating-ssl-files-using-openssl.html
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!