Bug #18540 | MetaData getColumnName() method don't work in some case | ||
---|---|---|---|
Submitted: | 27 Mar 2006 13:31 | Modified: | 28 Mar 2006 18:10 |
Reporter: | kadir doğan | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 5 beta | OS: | Windows (XP) |
Assigned to: | CPU Architecture: | Any |
[27 Mar 2006 13:31]
kadir doğan
[28 Mar 2006 18:10]
Tonci Grgin
Thanks for your bug report. I can not reproduce it. WinXP SP2, JDK 1.6, MySQL connector java 5.0.0 beta, 5.1.7-beta-nt-max-log: public void testPreparedStatement1() throws Exception { PreparedStatement st = con.prepareStatement("select FOO AS Col1 from booleanbug"); System.out.println("-----------------------------------"); System.out.println("Prepared stmt"); testResult(st.executeQuery()); } public void testStatement1() throws Exception { Statement st = con.createStatement(); System.out.println("Stmt"); testResult(st.executeQuery("select FOO AS Col1 from booleanbug")); } private void testResult(ResultSet rs) throws Exception { rs.next(); ResultSetMetaData md = rs.getMetaData(); System.out.println("ColName: " + md.getColumnName(1)); System.out.println("ColAlias: " + md.getColumnLabel(1)); System.out.println("ColVal: " + rs.getString(1)); } run: Stmt ColName: FOO ColAlias: Col1 ColVal: foo ----------------------------------- Prepared stmt ColName: FOO ColAlias: Col1 ColVal: foo