MySQL Forums
Forum List  »  Oracle

Re: Oracle Structure equivalent to MySQL
Posted by: Josh Chamas
Date: December 26, 2004 11:02PM

matthias.edrich wrote:
> Hi All,
> ...
> getTables(String catalog,String
> schemaPattern,String tableNamePattern,String[]
> types)
>
> I am quite successful leaving the "catalog" value
> as null as well as "schemaPattern."
>
> However, what would be the equivalent in MySQL to
> the Oracle "catalog" and "schema"?
>

In MySQL JDBC connector, the first argument, or catalog, to getTables() targets
the database or schema in MySQL, which is the collection of tables.
Currently, the 2nd schema argument does not seem to do anything.

ResultSet rs = dmd.getTables( "test", null, null, new String[] {"TABLE"} );
while(rs.next()) {
System.out.print(rs.getString(1) + ", " +
rs.getString(2) + ", " +
rs.getString(3) + ", " +
rs.getString(4) + ", " +
rs.getString(5) + ", " +
"\n");
}

The output of this program is a listing of tables in my local "test" schema/database:

test, null, emp, TABLE, ,
test, null, t1, TABLE, ,

So it would seem to me that the JDBC Oracle schema argument would work
the same as the MySQL JDBC catalog argument.

Regards,

Josh

Josh Chamas
Director, Professional Services
MySQL Inc., www.mysql.com
Get More with MySQL! http://www.mysql.com/consulting

Options: ReplyQuote


Subject
Views
Written By
Posted
5362
December 15, 2004 11:05AM
Re: Oracle Structure equivalent to MySQL
2849
December 26, 2004 11:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.