/** * */ package testsuite.simple; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.Timestamp; import java.util.Properties; import testsuite.BaseTestCase; public class TestBug43602 extends BaseTestCase { public TestBug43602(String name) { super(name); // TODO Auto-generated constructor stub } public void testBug43602() 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("-------------------------------------------------"); Properties props = new Properties(); props.put("jdbcCompliantTruncation", "true"); props.put("useInformationSchema","true"); Connection conn1 = null; try { conn1 = getConnectionWithProps(props); createTable("bug43602", "(`id` varchar(20) NOT NULL,`whenChanged` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1"); this.pstmt = conn1.prepareStatement("INSERT INTO bug43602 VALUES(?,?)"); this.pstmt.setString(1,"MyKey1"); java.sql.Timestamp ts = Timestamp.valueOf("2009-03-08 02:00:00"); this.pstmt.setTimestamp(2, ts); assertEquals(1, this.pstmt.executeUpdate()); }finally { if (conn1 != null) { conn1.close(); } } } finally { closeMemberJDBCResources(); } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub junit.textui.TestRunner.run(TestBug43602.class); } }