Arief Warazuhudien
Arief Warazuhudien

Reputation: 1

HSQLDB accessing database catalog without JDBC

Since we know hsqldb is run above java, and we can embed hsqldb lib into our java application, can we accessed hsqldb catalogs (table, table row, etc) as standard Java application, without using JDBC?,
example :
if we need som data from SOME_TABLE we not use

"SELECT * FROM SOME_TABLE" 

instead

List dataSet = HSQLDB.getTable("SOME_TABLE").getRows();

Upvotes: 0

Views: 162

Answers (1)

piotrek
piotrek

Reputation: 14520

probably yes, but...

  1. it's internal api - so don't use it unless you really have to because it may change in future
  2. it's internal api - so don't use it unless you really know how to use it
  3. it's internal api - so it may be private/package private so you may have to change the source/do permission hacks
  4. have you ever seen that api? does it look like that? it may be much more complicated than that. there might be no such thing as 'table'. dehydrated objects are stored in binary file and recreated after executing algebraic sql rules.
  5. how will you execute joins, subqueries, aggregations etc?
  6. are you sure it's java? maybe it's linked c library? then calling it from java will be impossible

to summarize: not sure what are your reasons to do it but it sounds like a really bad idea. if sql doesn't meet your needs maybe better check out for no-sql databases

Upvotes: 1

Related Questions