Blog Archive for October 5, 2010

Matching Wildcard In Database Table

October 5, 2010

I wanted to do a select that would match specific data in the table, or a wildcard row.

So my database contained

drumcoder
fred
*

If I selected matching on "drumcoder" I wanted the drumcoder row returned.

If I selected matching on "flibble" I wanted the * row returned.

I …

Tags: sql wildcard

Using Velocity Templates

October 5, 2010

Here's how to process a Velocity (http://velocity.apache.org/) template in Java code

First we need to set up properties to pass to the velocity processor. This will ensure the classpath is searched the the specified template.

// setup velocity environment
Properties lProperties = new Properties();
lProperties.put …