I have an Oracle table that has a CLOB in it. Inside this CLOB there may be an SQL statement. This can be changed at any time.
I am currently trying to dynamically run these SQL statements and return the column names and data back. This should be used to dynamically create a table on a web page.
Using Hibernate, I create a request and get this data:
List<Object[]> queryResults = null;
SQLQuery q = session.createSQLQuery(sqlText);
queryResults = q.list();
This gets the data I need, but not the column names. I tried to use the method getReturnAliases(), but it throws the error message that "java.lang.UnsupportedOperationException: SQL queries do not currently support returned aliases"
So my question is: is there a way using Hibernate to get these values dynamically?
source
share