package mytest; import java.sql.ResultSet; import java.sql.Statement; import testsuite.BaseTestCase; public class Bug22314 extends BaseTestCase { public Bug22314(String name) { super(name); } public void testBug22314() throws Exception { createTestTable(); Statement s = this.conn.createStatement(); ResultSet rs = s .executeQuery("SELECT CONCAT(firstname, lastname) AS name FROM BUG_22314"); while (rs.next()) { String name = rs.getString("name"); super.assertEquals("ToddFarmer", name); System.out.println(rs.getString("name")); } super.dropTable("BUG_22314"); } public static void main(String[] args) { junit.textui.TestRunner.run(Bug22314.class); } private void createTestTable() throws Exception { super.dropTable("BUG_22314"); this.stmt.executeUpdate("CREATE TABLE BUG_22314 " + "(firstname VARCHAR(10), lastname VARCHAR(10))"); this.stmt.executeUpdate("INSERT INTO BUG_22314" + " VALUES ('Todd', 'Farmer')"); } }