Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDBC-simulator for non-DB structures

Tags:

java

jdbc

Is there a framework to quickly build a JDBC-like interface for an internal data structure?

We have a complex internal data structure for which we have to generate reports. The data itself is persisted in a database but there is a large amount of Java code which manages the dependencies, access rights, data aggregation, etc. While it is theoretically possible to write all this code again in SQL, it would be much more simple if we could add a JDBC-like API to out application and point the reporting framework to that.

Especially since "JDBC" doesn't mean "SQL"; we could use something like commons jxpath to query our model or write our own simple query language.

[EDIT] What I'm looking for is a something that implements most of the necessary boiler plate code, so you can write:

 // Get column names and types from "Foo" by reflection
 ReflectionResultSet rs = new ReflectionResultSet( Foo.class );

 List<Foo> results = ...;
 rs.setData( results );

and ReflectionResultSet takes care of cursor management, all the getters, etc.

like image 308
Aaron Digulla Avatar asked Feb 16 '26 09:02

Aaron Digulla


2 Answers

It sounds like JoSQL (SQL for Java Objects) is exactly what you want.

like image 105
David Phillips Avatar answered Feb 18 '26 23:02

David Phillips


try googling "jdbe driver framework" The first (for me) looks like a fit for you: http://jxdbcon.sourceforge.net/

Another option that might work (also on the google results from the search above) is the Spring JDBC Templage. Here is a writeup http://www.zabada.com/tutorials/simplifying-jdbc-with-the-spring-jdbc-abstraction-framework.php

like image 32
DwB Avatar answered Feb 18 '26 23:02

DwB