JDBC - Generate native sql strings

O

oh_maan

Hi,

I am working on an adapter which would have to connect to multiple
databases using JDBC(not more than one at the same time). This adapter
would have to take the SQL to be executed in the form of, say, fields
to be retrieved, join condition, table name etc. I am not sure if all
the constraints specified by the user can be adequately represented in
ANSI SQL so as to make it DB independent. Would it be possible to
pass the query in some standard form (XML or anything else) and get
back the native SQL string to be executed using JDBC? Are you guys
aware of any third party libraries that would achieve this task?

I tinkered with the idea of using Hibernate to achieve this. But I was
unable to find any concrete material that supports the use of
hibernate in this fashion. The tricky bit is the fact that the DB type
and the SQL string are both available only at runtime and thus
generating of the hibernate mapping as well as the associated classes
would also have to be at runtime.

Any help would be greatly appreciated...

Thanks
Sreeram
 
S

steve

Hi,

I am working on an adapter which would have to connect to multiple
databases using JDBC(not more than one at the same time). This adapter
would have to take the SQL to be executed in the form of, say, fields
to be retrieved, join condition, table name etc. I am not sure if all
the constraints specified by the user can be adequately represented in
ANSI SQL so as to make it DB independent. Would it be possible to
pass the query in some standard form (XML or anything else) and get
back the native SQL string to be executed using JDBC? Are you guys
aware of any third party libraries that would achieve this task?

I tinkered with the idea of using Hibernate to achieve this. But I was
unable to find any concrete material that supports the use of
hibernate in this fashion. The tricky bit is the fact that the DB type
and the SQL string are both available only at runtime and thus
generating of the hibernate mapping as well as the associated classes
would also have to be at runtime.

Any help would be greatly appreciated...

Thanks
Sreeram

do a google search on " dbvisuliser" this will give you a very clear idea of
what is possible via java and sql

steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top