Test.java Source code

Java tutorial

Introduction

Here is the source code for Test.java

Source

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;

public class Test {
    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 "));
        }

    }
}