/** * Tonci */ package testsuite.simple; import java.sql.Connection; import java.util.Properties; import testsuite.BaseTestCase; public class TestBug48947 extends BaseTestCase { public TestBug48947(String name) { super(name); // TODO Auto-generated constructor stub } public void testBug48947() throws Exception { try { System.out.println("java.vm.version : " + System.getProperty("java.vm.version")); System.out.println("java.vm.vendor : " + System.getProperty("java.vm.vendor")); System.out.println("java.runtime.version : " + System.getProperty("java.runtime.version")); System.out.println("os : " + System.getProperty("os.name") + ", " + System.getProperty("os.version") + ", " + System.getProperty("os.arch")); System.out.println("sun.management.compiler : " + System.getProperty("sun.management.compiler")); System.out.println("-------------------------------------------------"); this.stmt.executeUpdate("DROP TABLE IF EXISTS bug48947"); this.stmt.executeUpdate("DROP VIEW IF EXISTS vbug48947"); createTable("`bug48947`", "(`fieldName` CHAR(10) NOT NULL PRIMARY KEY, `type` SMALLINT(6) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1;"); this.stmt.execute("CREATE VIEW vbug48947 AS SELECT `fieldName`, `type` AS `field_type` FROM bug48947"); this.rs = this.stmt.executeQuery("SELECT * FROM vbug48947"); java.sql.ResultSetMetaData rsmd = this.rs.getMetaData(); System.out.println(); System.out.println("View Name: vbug48947"); System.out.println("-------------------"); System.out.println("Column Label" + "\t" + "Column Name"); System.out.println("------------" + "\t" + "-----------"); int columnCount = rsmd.getColumnCount(); for (int i = 1; i <= columnCount; ++i) { System.out.println(rsmd.getColumnLabel(i) + "\t" + rsmd.getColumnName(i)); } } finally { closeMemberJDBCResources(); } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub junit.textui.TestRunner.run(TestBug48947.class); } }