public void testBug54095() throws Exception {
  Connection testConn=getConnectionWithProps("useLegacyDatetimeCode=false");
  Calendar testCal=Calendar.getInstance();
  java.util.Date origDate=testCal.getTime();
  PreparedStatement testPstmt=testConn.prepareStatement("SELECT ?");
  testPstmt.setTimestamp(1,new Timestamp(0),testCal);
  assertEquals("Calendar object shouldn't have changed after PreparedStatement.setTimestamp().",origDate,testCal.getTime());
  ResultSet testRs=testPstmt.executeQuery();
  testRs.next();
  assertEquals("Calendar object shouldn't have changed after PreparedStatement.executeQuery().",origDate,testCal.getTime());
  testRs.getTimestamp(1,testCal);
  assertEquals("Calendar object shouldn't have changed after ResultSet.getTimestamp().",origDate,testCal.getTime());
  testRs.close();
  testPstmt.close();
  testConn.close();
}

public void testBug54095 ( ) throws Exception { Connection testConn = getConnectionWithProps ( "useLegacyDatetimeCode=false" ) ; Calendar testCal = Calendar . getInstance ( ) ; java . util . Date origDate = testCal . getTime ( ) ; PreparedStatement testPstmt = testConn . prepareStatement ( "SELECT ?" ) ; testPstmt . setTimestamp ( 1 , new Timestamp ( 0 ) , testCal ) ; assertEquals ( "Calendar object shouldn't have changed after PreparedStatement.setTimestamp()." , origDate , testCal . getTime ( ) ) ; ResultSet testRs = testPstmt . executeQuery ( ) ; testRs . next ( ) ; assertEquals ( "Calendar object shouldn't have changed after PreparedStatement.executeQuery()." , origDate , testCal . getTime ( ) ) ; testRs . getTimestamp ( 1 , testCal ) ; assertEquals ( "Calendar object shouldn't have changed after ResultSet.getTimestamp()." , origDate , testCal . getTime ( ) ) ; testRs . close ( ) ; testPstmt . close ( ) ; testConn . close ( ) ; }
tests fix for bug # 54095 - unnecessary call in newsettimestampinternal . this bug was fixed as a consequence of the patch for bug # 71084 .
