GeeCON Prague 2014*
The moose likes JDBC 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
Bookmark "Processing None-SQL query via JDBC" Watch "Processing None-SQL query via JDBC" New topic
Author

Processing None-SQL query via JDBC

Amit Kumar Das
Greenhorn

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
http://www.linkedin.com/in/akumardas
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2501
    
    8

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
youtube channel
 
GeeCON Prague 2014
 
subject: Processing None-SQL query via JDBC