Is there any library to represent SQL queries as objects in Java code?
Posted
by Pregzt
on Stack Overflow
See other posts from Stack Overflow
or by Pregzt
Published on 2009-05-05T14:33:29Z
Indexed on
2010/05/16
11:30 UTC
Read the original article
Hit count: 217
I was wondering if there is any library that can be used to represent SQL queries as objects in Java.
In the code I have plenty of static variables of type java.lang.String that are hand written SQL queries. I would be looking for library having a nice fluent API that allows me to represent the queries as objects rather than strings.
Example:
Query q = select("DATE", "QUOTE")
.from("STOCKMARKET")
.where(eq("CORP", "?"))
.orderBy("DATE", DESC);
© Stack Overflow or respective owner