I have imported the JDBC library, set it to be compiled, and gave the App permission to access Internet. When a button on Screen is pressed, it should connect to the database and give me the values to implement in the list.
When I press the button, I can see it giving me the "Connecting to database" text, but after about half a second it says "Exception" as defined in that last catch block.
I commented out the three lines of code in onPostExecute, because when I kept them the App would just crash.
public void retrieveData(View view) {
    GetData retrieveData = new GetData();
    retrieveData.execute();
}
private class GetData extends AsyncTask<String,String,String> {
    String msg = "";
    static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
    static final String DB_URL = "jdbc:mysql://" + DbStrings.DATABASE_URL + "/" + DbStrings.DATABASE_NAME;
    @Override
    protected void onPreExecute() {
        progress.setText("Connecting to database");
    }
    @Override
    protected String doInBackground(String... strings) {
        Connection conn = null;
        Statement stmt = null;
        try {
            Class.forName(JDBC_DRIVER);
            conn = DriverManager.getConnection(DB_URL, DbStrings.USERNAME, DbStrings.PASSWORD);
            stmt = conn.createStatement();
            String sql = "SELECT * FROM video"; //
            ResultSet rs = stmt.executeQuery(sql);
            while(rs.next()) {
                String name = rs.getString("title");
                buildNames += name + " ### ";
            }
            msg = "Process complete.";
            rs.close();
            conn.close();
            stmt.close();
        } catch(SQLException connError) {
            msg = "An exception was thrown for JDBC.";
            connError.printStackTrace();
        } catch (ClassNotFoundException e) {
            msg = "A Class not found exception was thrown.";
            e.printStackTrace();
        } catch (java.sql.SQLException e) {
            msg = "Exception";
            e.printStackTrace();
        } finally {
            try{
                if(stmt != null) {
                    stmt.close();
                }
            } catch (java.sql.SQLException e) {
                e.printStackTrace();
            }
            try{
                if(conn != null) {
                    conn.close();
                }
            } catch (java.sql.SQLException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
    @Override
    protected void onPostExecute(String msg) {
        progress.setText(this.msg);
        //names = buildNames.substring(0,buildNames.length()-5).split(" ### ");
        //itemAdapter = new ItemAdapter(thisContext, buildNames.substring(0,buildNames.length()-5).split(" ### ")); //crashes
        //namesList.setAdapter(itemAdapter);
    }
}
}
