[ 
https://issues.apache.org/jira/browse/DERBY-3973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Hillegas updated DERBY-3973:
---------------------------------

    Attachment: DBMDWrapper.java

Attaching a second rev of the DBMDWrapper program. This version lets you change 
the connection used to get the DatabaseMetaData. Here is how you could use ij 
and the registered functions to explore metadata in Derby and in a MySQL 
database:

-- list all of the columns in the connected Derby database
select t.table_schem, t.table_name, c.column_name, c.type_name
from table( getTables( null, null, null ) ) t,
        table( getColumns( null, null, null, null ) ) c
where c.table_schem = t.table_schem
and c.table_name = t.table_name
and t.table_type = 'TABLE'
;


-- now list metadata in a foreign database
call setDatabaseURL( 'com.mysql.jdbc.Driver', 
'jdbc:mysql://localhost/world?user=root&password=' );

select t.table_schem, t.table_name, c.column_name, c.type_name
from table( getTables( 'WORLD', null, null ) ) t,
        table( getColumns( 'WORLD', null, null, null) ) c
where c.table_name = t.table_name
and t.table_type = 'TABLE'
;

-- release the foreign connection
call setDatabaseURL( '', '' );



> Create function wrappers for DatabaseMetaData so that you can join metadata 
> results in queries.
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3973
>                 URL: https://issues.apache.org/jira/browse/DERBY-3973
>             Project: Derby
>          Issue Type: Improvement
>          Components: Demos/Scripts
>    Affects Versions: 10.5.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: DBMDWrapper.java, DBMDWrapper.java
>
>
> Create a program to wrap the DatabaseMetaData methods in Derby functions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to