{{theTime}}

Search This Blog

Total Pageviews

How to read File Contents

private StringBuilder readFileContents(File file) {
StringBuilder builder = new StringBuilder() ;
try {
assert file.exists() ;
BufferedReader reader = new BufferedReader( new FileReader(file)) ;
while( reader.readLine() != null) {
builder.append ( reader.readLine()) ;
}
}catch(IOException e){
e.printStackTrace() ;
}
return builder ;
}

No comments:

Generate Insert Sql from Select Statement

SELECT 'INSERT INTO ReferenceTable (ID, Name) VALUES (' +        CAST(ID AS NVARCHAR) + ', ''' + Name + ''...