• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

class library representing SQL statement?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm looking for a library that manipulates SQL statements, something along the lines of:

It's for an application where the same data is being looked at by users with various combinations of permissions and preferences, so there's a core query that stays the same, with rows and columns added or taken away for specific invocations.
The other thing I'd like to be able to do is something like:

It's simple, it must have been done before, but my Google queries (eg "java sql") are unsuccessful. Thanks for any help.
--
Donal
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out Torque Criteria
 
Donal Lynch
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again,
Thanks Michael for the pointer to Torque, which I tried and liked. The best way of summarising its convenience is that Torque is to accessing databases as RMI is to accessing services over the network: it compiles database peer classes that represent information held in a database, saving the tedium of coding accessor methods and data conversions by hand, and hiding the conceptual mismatches of objects communicating with things that aren't objects.
However I have a doubt about whether Torque is appropriate for my application, which doesn't do much more than extracting tabular information from a database and displaying the same tabular information to the user. I don't know if it's worth converting each row in a table to an object of a specially compiled class when this object doesn't encapsulate any business functionality and doesn't participate in any interactions apart from getXxx and setXxx.
The small amount of intelligence in my application seems to be focussed on constructing queries and views of tabular data, so I'm looking for a class library that represents those concepts rather than hiding them. The Torque Criteria class looks like what I want, except I can't see any way of using it except by passing it to a Torque-generated database peer object, which I don't want.
 
Ranch Hand
Posts: 50
5
Oracle Postgres Database Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Back in 2002, there weren't many libraries that elegantly implemented SQL building in a typesafe way. Today, you have a broad choice. Just to name a few:

  • jOOQ: http://www.jooq.org
  • JaQu: http://www.h2database.com/html/jaqu.html
  • iciql: http://iciql.com/ (a friendly fork of JaQu)
  • Quaere: http://quaere.codehaus.org
  • Jequel: http://www.jequel.de (in maintenance mode, I think)
  • Squiggle: http://code.google.com/p/squiggle-sql (in maintenance mode, I think)


  • Apart from the above, there is always

  • Hibernate/JPA CriteriaQuery

  •  
    The moustache of a titan! The ad of a flea:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic