Tuesday, March 10, 2009

Change Display Font Size on Lotus Notes

I always liked smaller display fonts on my applications... but ever tried to change the font size on your Lotus Notes? Well, you can change the font, but not the font size! Is that not funny? IBM guys, hope you read my blog ;-)

By the way, if you want to reduce the font size... do this...
Under the \Notes directory, you will find a file 'notes.ini'. Edit that file and put the following entry to change the font size:
....
EnableJavaApplets=1
EnablePlugins=1
...
Display_Font_Adjustment=1

The one in BOLD above is the entry you need to put to adjust your font size. Higher the number, bigger the font. You can also go in negative to reduce it further. e.g. I love the Georgia font, really small i.e. about 8pt. The above numbers are in pixels (I guess), so go as low as -1 or -2 to have a really small display!

Friday, March 6, 2009

Retrieve BLOB column in Sybase

In one of my recent projects, I was expected to explain something to client, which involved retrieving binary large object data from Sybase! So, you might think, what was the big challenge in this? It's BLOB! Just use the JDBC API and call the getBlob() method of the ResultSet!

Yeps, so, why don't you try that? Give it a try. I used the jconn3 driver to connect to my Sybase database. Driver Class being 'com.sybase.jdbc3.jdbc.SybDriver'. The moment you try to call the getBlob() method, you will get a nice exception stack trace, informing you that this is an unsupported operation! Yeps, its not as straight forward as that!

But don't worry, it actually is even more simple! For fetching the BLOB data all you need to do is:

// build a byte array
byte stuff[] = resultSet.getBytes();

// check the size of the data now
System.out.println("BLOB Size: " + stuff.length);

Congratulations! You have retrieved the BLOB data from a Sybase IMAGE column!!!