Reputation: 1168
I'm learning about JDBC and I don't understand something.
I know that the code to open the connection is:
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/database?autoReconnect=true&useSSL=false", "root", "password");
And I have 2 question:
Thanks in advance!
Upvotes: 2
Views: 4772
Reputation: 404
SSL is a cryptographic protocol which can encrypt all data communicated between the JDBC driver and the server. To use SSL you have to set it up first link. The useSSL attribute: default is 'true' when connecting to MySQL 5.5.45+, 5.6.26+ or 5.7.6+, otherwise default is 'false'
The MySQL client library can perform an automatic reconnection to the server if it finds that the connection is down when you attempt to send a statement to the server to be executed. If auto-reconnect is enabled, the library tries once to reconnect to the server and send the statement again.
Upvotes: 1