I need to Convert My result set to an array of Strings. I am reading Email addresses from the database and I need to be able to send them like:
message.addRe
you do not need arr = em.split("\n"); since you are looping through each row (assuming that 1 row = 1 email address ) you just need this :
arr = em.split("\n");
ArrayList arr = new ArrayList(); while (rs.next()) { arr.add(rs.getString("EM_ID")); System.out.println(arr.get(arr.size()-1)); }