情景
你在後台寫sql文訪問數據庫時是不是要這樣寫
String sql=
+
+
+
String sql=
+
+
+
當sql語句短還好
代碼
import java
import java
public class GenSqlString {
/**
* 處理長字符串拼接
* @param args
*/
public static void main(String[] args) {
ArrayList<String> array = new ArrayList<String>();
Scanner scn = new Scanner(System
String line;
String reString;
System
//BufferedReader br=new BufferedReader(new InputStreamReader(System
//String reString=
/** 當輸入end時回車結束*/
while (!
array
}
System
int i=
for(String str : array){
if(i==
reString=
}else if(i==array
reString=
}else{
reString=
}
System
i++;
}
}
}
import java
import java
public class GenSqlString {
/**
* 處理長字符串拼接
* @param args
*/
public static void main(String[] args) {
ArrayList<String> array = new ArrayList<String>();
Scanner scn = new Scanner(System
String line;
String reString;
System
//BufferedReader br=new BufferedReader(new InputStreamReader(System
//String reString=
/** 當輸入end時回車結束*/
while (!
array
}
System
int i=
for(String str : array){
if(i==
reString=
}else if(i==array
reString=
}else{
reString=
}
System
i++;
}
}
}
雖然簡單點
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28248.html