Java Android mysql connection not working for 4.0

hello123

New Member
I am working on an app that when I use Android 2.3.3 when trying to connect to MySQL DB it works fine. I then ran a test with Android 4.0 and it is giving me this Exception:\[code\]com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server\[/code\]The blip seems to be on this line of code which like I said above worked for 2.3.3 and not for 4.0:\[code\]conn = DriverManager.getConnection(DB_URL, USER, PASS);\[/code\]I even tried running the app on my Samsung Galaxy S3 to see if it would work on that and it did not work. It didnt crash it just throws the above exception. Does anyone have any ideas why it is doing this. If I did not supply enough information please let me know what else I need to specify to make this more clear.The mysql connector I am using is this here:\[code\]mysql-connector-java-5.1.23-bin.jar\[/code\]I hope this helps in trying to figure out the issue.Code:\[code\]...static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";...try { // STEP 2: Register JDBC driver Class.forName(JDBC_DRIVER); // STEP 3: Open a connection conn = DriverManager.getConnection(DB_URL, USER, PASS); << here is the exception it is telling me.\[/code\]
 
Back
Top