Well the reason for this post is to ask those who have already tried and / or those who are curious as I am. Well I am creating an android application that is used to execute SQL commands on a remote MYSQL server installed on a CENTOS7 platform, my server was already configured to accept remote connections to that server. The question is: Does MYSQL JDBC only work to work in databases in a local way, that is, the application would only work in local exclusively? I have seen several posts saying that it is best to use web service and php thing that had already done in other remote servers, but to access the server the most logical would be to use the connector itself and Mysql commands within android studio. When trying to create a connection;
conexionmysql=DriverManager.getConnection("jdbc:mysql://ip.ip.ip.ip:3306/mibasededatos" ,"unusuariovaaqui" ,"unacontraseñax");
When trying to execute the command that establishes connection to the server I get this:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
Well that's my little question if someone has tried to tell me how you did it.