/** * BUG#41484 */ package testsuite.simple; import testsuite.BaseTestCase; /** * @author Tonci * */ public class TestBug41484 extends BaseTestCase { /** * @param name */ public TestBug41484(String name) { super(name); // TODO Auto-generated constructor stub } public void testBug41484() throws Exception { 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.name : " + System.getProperty("os.name")); System.out.println("os.version : " + System.getProperty("os.version ")); System.out.println("sun.management.compiler : " + System.getProperty("sun.management.compiler")); try { createTable("bug41484", "(id int not null primary key, day date not null) DEFAULT CHARSET=utf8"); this.pstmt = this.conn.prepareStatement("INSERT INTO bug41484(id, day) values(1, ?)"); this.pstmt.setInt(1, 20080509); assertEquals(1, this.pstmt.executeUpdate()); this.pstmt.close(); this.pstmt = this.conn.prepareStatement("SELECT * FROM bug41484 WHERE id = ?"); this.pstmt.setInt(1, 1); this.rs = this.pstmt.executeQuery(); this.rs.first(); System.out.println(this.rs.getString("day"));// getString(1)); this.rs.close(); this.pstmt.close(); this.pstmt = this.conn.prepareStatement("INSERT INTO bug41484(id, day) values(2, ?)"); this.pstmt.setInt(1, 20090212); assertEquals(1, this.pstmt.executeUpdate()); this.pstmt.close(); this.pstmt = this.conn.prepareStatement("SELECT * FROM bug41484 WHERE id = ?"); this.pstmt.setInt(1, 2); this.rs = this.pstmt.executeQuery(); this.rs.first(); assertEquals(this.rs.getString(1), "2"); System.out.println(this.rs.getString("day")); this.rs.close(); this.pstmt.close(); } finally { closeMemberJDBCResources(); } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub junit.textui.TestRunner.run(TestBug41484.class); } }