jeudi 26 mars 2015

confusion : string is immutable so don't use for concatenation

JAVA : I want to clear that using String like this



String str = " SELECT "
+ "field1, "
+ "field2, "
+ "field3 "
+ " FROM table1; ";


is okay or not to use this way.


asking based on best practice regarding String not to use for concatenation.


THIS IS VERY SHORT QUERY BUT ACTUALLY WE HAVE VERY VERY LARGE QUERY. THIS IS JUST EXAMPLE. SO JUST WANT TO CONFIRM I AM NOT DOING ANY THING WRONG.


Aucun commentaire:

Enregistrer un commentaire