I want to get :
String[] phoneNos= {"07064267499","07064267499","07064267499"};
from :
ArrayList<Object> phoneNos = [0803406914, 08167337499, 0803377973] ;
This is my code snippet :
public ArrayList < Object > getPhoneNo() {
ArrayList < Object > phoneNos = new ArrayList < Object > ();
try {
Statement stmt = con.createStatement();
ResultSet result = stmt.executeQuery("SELECT Phone_No FROM paient_details");
while (result.next()) {
phoneNos.add(result.getString(1));
}
} catch (SQLException e) {
System.out.println(e.getMessage());
}
return phoneNos;
}