Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

JRC stands for Java Relational Combinator.

It is a pure Java solution for cross-dbms SQL. It allows easy code reuse of SQL code and dbms neutrality.

Features of JRC include:

  • Capability of combining simple relation objects to create more sophisticated relation object, for example:
    Code Block
    Relation relation = Relations.parse("select a, b from table1").where("c>1").orderBy("c");
    Relation joined= relation.alias("t1").join(Relations.table("table2").alias("t2"), "");
  • Provide enhanced dbms neutral SQL support. For example, one can use functions and enhanced features and the SQL will be translated to the SQL extension on the target dbms. For example:
    Code Block
    select a, substr(b, 1, 2), case c when 1: "yes" else "no" end
    from table1 t1 inner join table2 t2
    on = and t1.(a,b,c) > t2.(a,b,c) 
    This SQL will be translated to Microsoft Transact-SQL as:
    Code Block
    select a, substring(b, 1, 2), case c when 1 then "yes" else "no" end
    from table1 t1 inner join table2 t2
    on and (t1.a>t2.a or t1.a=t2.a and (t1.b>t2.b or t1.b=t2.b and t1.c>t2.c))
    As you shown in the example, jrc functions will be translated into the corresponding function in the target dbms. Enhanced sql features such as group comparison is also translated. Therefore one can write dbms neutral SQL code and still be able to use features not defined in the ANSI SQL standard.

Architectural topics:

Children Display