public class ReadSql {
public static void readsql(String filePath) throws Exception{
String encoding = gbk;
File file = new File(filePath);
if(fileisFile()&&fileexists()){
InputStreamReader reader = new InputStreamReader(new FileInputStream(file)encoding);
BufferedReader bufferedReader = new BufferedReader(reader);
String line = null;
while ((line = bufferedReaderreadLine())!=null) {
Systemoutprintln(linetoString());
}
readerclose();
}
}
public static void main(String[] args) throws Exception {
Systemoutprintln(=================================================);
ReadSqlreadsql(c:/rrtxt);
Systemoutprintln(=================================================);
}
}