Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

12 August 2008

JAVA_HOME on mac

export JAVA_HOME=/Library/Java/Home

07 May 2008

CallableStatement date&time parameter

After spending an enormous amount of time trying to include the time with a java.sql.Date call to a Stored Procedure through CallableStamtent I found out that CS also accepts Timestamp...that really made my day =)

11 March 2008

Write data to a file in the filesystem


FileOutputStream fs = new FileOutputStream( ABSOLUTE_PATH_TO_FILE );
fs.write( SOME_DATA );
fs.close();

19 September 2007

Date Formatting


// Use SimpleDateFormat to format the display of date Strings
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
return sdf.format(new Date());

Read file contents

// Read each line of the file infile.txt


BufferedReader rdr = new BufferedReader( new InputStreamReader(new FileInputStream("infile.txt"), "ISO-8859-1"));
String line = rdr.readLine();