An aesthetic technical query

Apr 26, 2009 13:11

Java fans: what's the prettiest way to embed SQL into your program? I understand the mechanics of using prepared statements and JDBC, but all the examples I can find are ugly. They use a style rather like this:

private String _actor_mid_sql = "SELECT a.fname, a.lname FROM Actor a, Casts c ( Read more... )

Leave a comment

Comments 1

(The comment has been removed)

samildanach April 26 2009, 21:08:35 UTC
I thought so, too, but it looks like that's a C feature they discarded. The approved technique seems to be to break strings with " and re-join them with +, which adds a huge amount of visual noise into the query.

Reply


Leave a comment

Up