package mytest; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import testsuite.BaseTestCase; public class Bug22215 extends BaseTestCase { public Bug22215(String name) { super(name); } public static void main(String[] args) { junit.textui.TestRunner.run(Bug22215.class); } public void testBug22215() throws Exception { createTestTable(); Connection myConn = this.conn; PreparedStatement s = myConn.prepareStatement("SELECT i FROM BUG_22215"); ResultSet rs = s.executeQuery(); boolean returnedValue = false; while (rs.next()) { short sh = rs.getShort("i"); super.assertEquals(255, sh); returnedValue = true; } super.assertTrue(returnedValue); super.dropTable("BUG_22215"); } private void createTestTable() throws Exception { super.dropTable("BUG_22215"); this.stmt .executeUpdate("CREATE TABLE BUG_22215 ( i TINYINT UNSIGNED )"); this.stmt .executeUpdate("INSERT INTO BUG_22215 VALUES (255)"); } }