Advertisement
Guest User

Untitled

a guest
Sep 10th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. Sat Sep 10 17:38:48 BOT 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
  2.  
  3. package comm.estudiante.dao.mysql;
  4.  
  5.  
  6. import comm.estudiante.dao.mysql.interfaces.DBConnection;
  7. import java.sql.Connection;
  8. import java.sql.DriverManager;
  9. import java.sql.ResultSet;
  10. import java.sql.SQLException;
  11. import java.sql.Statement;
  12.  
  13. public class MySQLDBConnection implements DBConnection {
  14.  
  15. String host = "localhost";
  16. String port = "3306";
  17. String db = "itla";
  18. String table = "notas";
  19. String user = "root";
  20. String pass = "itla";
  21. String url = "jdbc:mysql://" + host + ":" + port + "/" + db + "?user="
  22. + user + "&password=" + pass;
  23. Connection con;
  24. Statement stmnt;
  25. ResultSet rs;
  26.  
  27. public Connection conectar() throws SQLException {
  28. return DriverManager.getConnection(url);
  29. }
  30.  
  31. @Override
  32. public void desconectar(Connection con) {
  33. if (con != null) {
  34. try {
  35. con.close();
  36. } catch (SQLException ex) {
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement