> String fieldText = String.format("'%s'", text);
Beware of SQL injection (and syntax errors) there!
check this out:
text = " '; DROP DATABASE my_database; --";
There is an explicit warning about SQL injection in jOOQ's plain SQL
methods' Javadoc. E.g.
http://www.jooq.org/javadoc/latest/org/jooq/impl/Factory.html#field(java.lang.String)
Either, you properly escape your text yourself, or you let jOOQ do it
using Factory.inline()
> BTW, I find the number 5 is a magic number. I try to get the column size
> from my JOOQ java code, but I can't.
As I said, column length, precision and scale will only be available
in jOOQ 3.0. In order to introduce them, I had to (slightly)
incompatibly change the DataType implementations. That's why I waited
for a major release.
Cheers
Lukas