This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes getTables schema question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "getTables schema question" Watch "getTables schema question" New topic
Author

getTables schema question

Paul Bergin
Greenhorn

Joined: Sep 27, 2002
Posts: 2
Hi,
hope you can help me out.
I have written a tool which can connect to different databases via JDBC or ODBC, it has been working perfectly till now.
The problem I am having is retrieving tables for a specific schema/view.
Up to now I have been using the userid (which the user connects to the db with) as the schema name,
DatabaseMetaData.getTables(catalog, schema, tableNamePattern, types)
but I now have client who uses the ODBC name to identify the schema, so my question is,
Which is more commonly used to identify a schema, userid or ODBC name.
AND
If I was to get get a list of the schemas with
DatabaseMetaData.getSchemas()
and compare user name and odbc name to the list of schemas, if both appeared in the scheam list, which would normally take priority?
Regards
Paul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getTables schema question
 
Similar Threads
Ivor's Book
using netbeans database wizard to connect to msaccess northwind database
Schema and Database
Help with this error [ODBC Microsoft Access Driver]Optional feature not implemented
JPA (HIbernate) with Multiple Database Schemas