问题
My programm will get an input of a valid sql, and should return column names for the sql. And I want to do this with out executing the sql statement at all. I am looking for a java solution.
My dbms is oracle optimized for olap, and the tables are so big that result set restriction does not working. Actually execution time is not acceptable for my case. it takes longer than a minute
回答1:
Prepare the query, but rather than executing it, just call getMetaData on the prepared statement. Provided your driver supports it, this should return the result set meta data with the column descriptions without executing a query.
来源:https://stackoverflow.com/questions/9207073/column-names-for-an-ad-hoc-sql