aspose file tools
The moose likes JDBC and the fly likes tables and fields Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "tables and fields" Watch "tables and fields" New topic
Author

tables and fields

Xinyi Zhang
Ranch Hand

Joined: Apr 28, 2001
Posts: 42
How to list tables in specific database and how to find field name and its data type using Java program? Thanks.


Xinyi
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
See the javadocs on java.sql.Connection#getMetaData(). Calling myConnection.getMetaData().getTables(null, null, null, null) should return all tables.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: tables and fields
 
Similar Threads
Joins
Increasing performance through indexing
hibenrate Query...
2 tables
JDBC doesn't retrieve all the results available in the MSSQL database