Pure-Essence.Net

Archive for the ‘geeky’ Category

Spring: check if a column exist using resultset

Posted by: pureessence on: May 12, 2011

If you have a strange requirement in the rowMapper to check if a column exists or not, you could try to catch a SQLException of invalid column name or you could try:

Dynamically invoke methods using spring config

Posted by: pureessence on: March 25, 2011

A business rule at work requires some flexible configurations. I attempted to fulfill the need by create different spring batch steps/tasklets to execute each requirement based on a property value. For example, step 1 will need to execute methodOne on the class Repository with the appropriate parameters. The method signature & parameters are determined by [...]

How to execute IN() SQL in spring jdbcTemplate

Posted by: pureessence on: March 16, 2011

So for a long time, I wondered how you’d do the sql IN() using spring jdbcTemplate. Today I had an opportunity to work it out. Normally I used It’s not too friendly if you do If you wish to use the “where in” sql, there is a pretty elegant way to do it in spring [...]

Use modal windows for delete confirmations please

Posted by: pureessence on: March 1, 2011

While reviewing an existing project at work, I notice it has many delete confirmation pages. In my opinion, delete confirmation PAGES should really just retire from the face of the earth. Seriously, why do we need to create a http request & html for the mere purpose of asking “Are you sure you wish to [...]

Spring loading properties from database with a twist

Posted by: pureessence on: February 10, 2011

Watched the spring framework 3.1 webinar today and it was pretty interesting. Anyway, at work we are trying to possibly load property values from a database to resolve some tension between the developers and system specialists. I played a little bit at home as how we would set this up. This is not a new [...]

itext page number (page x of y)

Posted by: pureessence on: November 14, 2010

I was looking for a complete example of how to dynamically generate the page numbers when you create the pdf using iText and I couldn’t find one. This is based on the example in the iText in Action book but I added my “refactoring” if you will. I hope this helps someone. If not, it [...]

Java instaniate an abstract class… sort of…

Posted by: pureessence on: August 27, 2010

At work I had to create some test data for a junit test. The function I’m testing expects a super abstract class to be passed in and I need to test the same function for bunch of child classes. I wish I could just pass in the parent class but since it’s abstract I cannot [...]

Setting private property without setter in Java

Posted by: pureessence on: August 25, 2010

Not really a new trick but I had to look for the syntax today to use reflection to set a private property on an object to use it in a junit test.

writing an ajax app for Sequence

Posted by: pureessence on: August 2, 2010

Yesterday I attended Ted Neward‘s game design session at nofluff. It inspired me to begin to implement the game sequence in an ajax app. It will be a private app since I only plan to play it with some friends. But it will be hosted somewhere on my website so it can be accessed from [...]

WordPress 3.0 is out

Posted by: pureessence on: June 17, 2010

Tags:

My most adorable Pomeranians

Categories

Archives

SocialVibe


Follow

Get every new post delivered to your Inbox.

Join 123 other followers