Using the mysql-connector-java.5.1.26-bin.jar to connect my android app to a remote mysql host. Problem is, anything above minSdkVersion 9 casuses the "Communications link failure". If I have it set to 9, it connects fine and gets database information. Here's my connection code:
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url, user, pass);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from users");
ResultSetMetaData rsmd = rs.getMetaData();
while(rs.next()) {
....
}
}
catch(Exception e) {
e.printStackTrace();
}
Any ideas as to why this is happening?