Example usage for java.sql DatabaseMetaData getPseudoColumns

List of usage examples for java.sql DatabaseMetaData getPseudoColumns

Introduction

In this page you can find the example usage for java.sql DatabaseMetaData getPseudoColumns.

Prototype

ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern,
        String columnNamePattern) throws SQLException;

Source Link

Document

Retrieves a description of the pseudo or hidden columns available in a given table within the specified catalog and schema.

Usage

From source file:Test.java

public static void main(String[] args) throws Exception {
    Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/contact", "userName", "password");
    DatabaseMetaData metaData = con.getMetaData();
    ResultSet resultSet = metaData.getPseudoColumns("", "schemaName", "tableName", "");

    while (resultSet.next()) {
        System.out.println(resultSet.getString("TABLE_SCHEM ") + " - " + resultSet.getString("COLUMN_NAME "));
    }// w  w w  .j  a v a  2s  .  c  o m

}