I try to insert my ArrayList<LatLng> list1
with a lot of values like this: (99.9999999,99.9999999)
to table in database MySQL, exacly to 1 column, something like this:
row 1 (99.9999999,99.9999999)
row 2 (99.9999999,99.9999999)
row 3 (99.9999999,99.9999999)
... all to 1 column.
In my opinion, currently i have a good method for this:
String sql = "INSERT INTO table1 VALUES(";
for(String s : list1) {
sql = sql+"'"+s+"'";
}
sql = sql+")";
stmt.executeUpdate(sql);
but Android Studio underlines String s
and says:
Incompatible types
Required: com.google.android.gms.maps.model.LatLng
Found: java.lang.String
In my opinion, Android Studio trying to say me: you need to convert all values from ArrayList<LatLng> list1
to String
!
Is it possible to convert all values from my ArrayList
in one method ?