I created this snippet: public static String[] get_data() { conn = getInstance(); ... You have defined your variable inside the while loop i.e. it is not visible to the return ...
stackoverflow.com