db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5244) DatabaseMetaData.getColumns(null, null, tableName, null) does not return the columns meta for a SYNONYM
Date Fri, 11 Nov 2011 17:03:51 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148574#comment-13148574
] 

Mamta A. Satoor commented on DERBY-5244:
----------------------------------------

Yes, Mike, I should have elaborated more on option 2). It is just not adding the rows in SYSCOLUMNS
but also maintaining them as needed based on say ALTER TABLE.. DROP COLUMN, ALTER TABLE ..
ADD COLUMN, DROP TABLE, DROP SYNONYM etc. There might be more than these few commands that
might impact what happens to rows in SYSCOLUMNS for synonyms.
                
> DatabaseMetaData.getColumns(null, null, tableName, null) does not return the columns
meta for a SYNONYM
> -------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5244
>                 URL: https://issues.apache.org/jira/browse/DERBY-5244
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.8.1.2
>         Environment: Windows
>            Reporter: Prashanth Godey
>            Priority: Minor
>              Labels: SYNONYM, getColumns
>
> DatabaseMetaData.getColumns(null, null, tableName, null) does not return the columns
meta for a SYNONYM.
> Sample java code use for testing.
> /**
>  * ListColumns.java
>  */
> import java.sql.*;
> import java.util.Properties;
> public class ListColumns {
> 	public static void main(String[] args) {
> 		Connection con = null;
> 		try {
> 			Class.forName("org.apache.derby.jdbc.ClientDriver");
> 			
> 			Properties connectionProps = new Properties();
> 			connectionProps.put("user", "app");
> 			connectionProps.put("password", "app");
> 			
> 			con = DriverManager.getConnection(
> 					"jdbc:derby://localhost:1527/northwind", connectionProps);
> 			String tableName = "V1";
> 			DatabaseMetaData meta = con.getMetaData();
> 			System.out.println("Database Product Version"
> 					+ meta.getDatabaseProductVersion());
> 			ResultSet res = meta.getColumns(null, null, tableName, null);
> 			System.out.println("List of columns for " + tableName);
> 			while (res.next()) {
> 				System.out.println("  " + res.getString("TABLE_SCHEM") + ", "
> 						+ res.getString("TABLE_NAME") + ", "
> 						+ res.getString("COLUMN_NAME") + ", "
> 						+ res.getString("TYPE_NAME") + ", "
> 						+ res.getInt("COLUMN_SIZE") + ", "
> 						+ res.getString("NULLABLE"));
> 			}
> 			res.close();
> 			con.close();
> 		} catch (java.lang.ClassNotFoundException e) {
> 			System.err.println("ClassNotFoundException: " + e.getMessage());
> 		} catch (SQLException e) {
> 			System.err.println("SQLException: " + e.getMessage());
> 		}
> 	}
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message