title: Data won't be retrieved from mySQL by using JDBC in android studio
body: <p>I am trying to retrieve data from mySQL in android studio, However i cannot return any value, but some error pops up at the logcat. Here are my codes:</p>
  
  <hr>
  
  <p>My table:
  <a href="https://i.stack.imgur.com/7lGNN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7lGNN.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>For Connection Class:</p>
  
  <p><a href="https://i.stack.imgur.com/eRerr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eRerr.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>I used AsyncTask on MainActivity:</p>
  
  <pre><code>private class viewDetail extends AsyncTask&lt;String, String, String&gt; {
  
      String z = "";
      boolean isSuccess = false;
  
      String about;
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
      }
  
      @Override
      protected String doInBackground(String... params) {
  
          try {
              Connection con = connectionClass.CONN();
              if (con == null) {
                  z = "Please check your internet connection";
              } else {
  
                  String query = "select * from medicines where name ='amoxicillin'";
  
  
                  Statement stmt = con.createStatement();
  
                  ResultSet rs = stmt.executeQuery(query);
  
                  while (rs.next()) {
                      about = rs.getString("about");
                  }
              }
          } catch (Exception ex) {
              isSuccess = false;
              z = "Exceptions" + ex;
          }
          return z;
      }
      @Override
      protected void onPostExecute(String s) {
      Toast.makeText(getBaseContext(), about + z, Toast.LENGTH_LONG).show();
  
       if (isSuccess) {
              Toast.makeText(getBaseContext(), "Success!", Toast.LENGTH_LONG).show();
          }
      }
  }
  </code></pre>
  
  <p>There's my code, quite messy. But the thing is I can't retrieve any data, </p>
  
  <p>The error says "The url cannot be null" </p>