com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: in mysql

后端 未结 4 1304
时光取名叫无心
时光取名叫无心 2021-01-11 21:58

Hi I have created jdbc program and database is MySQL 5.1 Also all my friends using same database for connection. Total number of connection became 150 from all of us. So whe

4条回答
  •  心在旅途
    2021-01-11 22:50

    when you make a connection from higher versions of android version 9 to a mysql server you must always allow connections through:

    if (Constants.VERSION_SDK > 9) {
          StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
          StrictMode.setThreadPolicy(policy);
    }
    

提交回复
热议问题