File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Processing None-SQL query via JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Processing None-SQL query via JDBC" Watch "Processing None-SQL query via JDBC" New topic

Processing None-SQL query via JDBC

Amit Kumar Das

Joined: Feb 26, 2011
Posts: 2

I was just building my own query processor. I found a problem in dealing with vendor-specific commands.
for Ex: if i want to run "DESC <Table Name>", It result in an Exception, which is quite obvious as it is not an SQL command.
Now if I want to access Table Metadata, I need to develop my own method.
What could be the possible ways for doing that??

Amit Kumar Das, ASE @ TCS Kolkata, India
Jan Cumps

Joined: Dec 20, 2006
Posts: 2562

desc <tablename> is not a database command. It is an sql*plus command. The database does not understand it (as you have noticed by the exceprion).
java.sql.ResultSet.getMetaData() can help you.

OCUP UML fundamental and ITIL foundation
I agree. Here's the link:
subject: Processing None-SQL query via JDBC
It's not a secret anymore!