K
Ken
I just looked at hibernate... but have never used it.
Can it or any other main stream java tools query databases with an
optional WHERE clause?
What I mean is I have a number of cases where people fill in forms
with quite a few criteria and then I need to build a query. I've been
concatenating strings recently to make this work (although in my
defense I've been programing in IBM RPG, yes that language that
started on punch cards...) but I want to know how to do this
effectively in Java.
I know it is probably possible to build all the needed statements in
SQL conditional logic but I think it will make the statements far more
complicated.
I'd imagine there is a nice API for which you simply create a
statement object and then specify it's type (such as SELECT) and then
add constraints via the API and don't need to mess around doing
painful string concatenations.
I think this can be done with SQL PL? But I don't have access to SQL
PL in my environment but am hoping for some tool that can add this
functionality.
Something like:
Stmt stmt = new stmt();
Select select = new select(stmt);
select.addField("name");
select.from("people");
if (somecondition != null)
select.addWhere("x > " + somecondition);
endif;
Or perhaps there is something that even makes the above look like work
=)
Can it or any other main stream java tools query databases with an
optional WHERE clause?
What I mean is I have a number of cases where people fill in forms
with quite a few criteria and then I need to build a query. I've been
concatenating strings recently to make this work (although in my
defense I've been programing in IBM RPG, yes that language that
started on punch cards...) but I want to know how to do this
effectively in Java.
I know it is probably possible to build all the needed statements in
SQL conditional logic but I think it will make the statements far more
complicated.
I'd imagine there is a nice API for which you simply create a
statement object and then specify it's type (such as SELECT) and then
add constraints via the API and don't need to mess around doing
painful string concatenations.
I think this can be done with SQL PL? But I don't have access to SQL
PL in my environment but am hoping for some tool that can add this
functionality.
Something like:
Stmt stmt = new stmt();
Select select = new select(stmt);
select.addField("name");
select.from("people");
if (somecondition != null)
select.addWhere("x > " + somecondition);
endif;
Or perhaps there is something that even makes the above look like work
=)