private int insertTestDataLocalDTTypes(PreparedStatement pstmt) throws Exception {
  pstmt.setInt(1,1);
  pstmt.setDate(2,testSqlDate);
  pstmt.setTime(3,testSqlTime);
  pstmt.setTimestamp(4,testSqlTimeStamp);
  pstmt.setTimestamp(5,testSqlTimeStamp);
  assertEquals(1,pstmt.executeUpdate());
  pstmt.setInt(1,2);
  pstmt.setObject(2,testLocalDate);
  pstmt.setObject(3,testLocalTime);
  pstmt.setObject(4,testLocalDateTime);
  pstmt.setObject(5,testLocalDateTime);
  assertEquals(1,pstmt.executeUpdate());
  pstmt.setInt(1,3);
  pstmt.setObject(2,testLocalDate,JDBCType.DATE);
  pstmt.setObject(3,testLocalTime,JDBCType.TIME);
  pstmt.setObject(4,testLocalDateTime,JDBCType.TIMESTAMP);
  pstmt.setObject(5,testLocalDateTime,JDBCType.TIMESTAMP);
  assertEquals(1,pstmt.executeUpdate());
  pstmt.setInt(1,4);
  pstmt.setObject(2,testLocalDate,JDBCType.DATE,10);
  pstmt.setObject(3,testLocalTime,JDBCType.TIME,8);
  pstmt.setObject(4,testLocalDateTime,JDBCType.TIMESTAMP,20);
  pstmt.setObject(5,testLocalDateTime,JDBCType.TIMESTAMP,20);
  assertEquals(1,pstmt.executeUpdate());
  pstmt.setInt(1,5);
  pstmt.setObject(2,testLocalDate,JDBCType.VARCHAR);
  pstmt.setObject(3,testLocalTime,JDBCType.VARCHAR);
  pstmt.setObject(4,testLocalDateTime,JDBCType.VARCHAR);
  pstmt.setObject(5,testLocalDateTime,JDBCType.VARCHAR);
  assertEquals(1,pstmt.executeUpdate());
  pstmt.setInt(1,6);
  pstmt.setObject(2,testLocalDate,JDBCType.VARCHAR,10);
  pstmt.setObject(3,testLocalTime,JDBCType.VARCHAR,8);
  pstmt.setObject(4,testLocalDateTime,JDBCType.VARCHAR,20);
  pstmt.setObject(5,testLocalDateTime,JDBCType.VARCHAR,20);
  assertEquals(1,pstmt.executeUpdate());
  if (pstmt instanceof CallableStatement) {
    CallableStatement cstmt=(CallableStatement)pstmt;
    cstmt.setInt("id",7);
    cstmt.setDate("d",testSqlDate);
    cstmt.setTime("t",testSqlTime);
    cstmt.setTimestamp("dt",testSqlTimeStamp);
    cstmt.setTimestamp("ts",testSqlTimeStamp);
    assertEquals(1,cstmt.executeUpdate());
    cstmt.setInt("id",8);
    cstmt.setObject("d",testLocalDate);
    cstmt.setObject("t",testLocalTime);
    cstmt.setObject("dt",testLocalDateTime);
    cstmt.setObject("ts",testLocalDateTime);
    assertEquals(1,cstmt.executeUpdate());
    cstmt.setInt("id",9);
    cstmt.setObject("d",testLocalDate,JDBCType.DATE);
    cstmt.setObject("t",testLocalTime,JDBCType.TIME);
    cstmt.setObject("dt",testLocalDateTime,JDBCType.TIMESTAMP);
    cstmt.setObject("ts",testLocalDateTime,JDBCType.TIMESTAMP);
    assertEquals(1,cstmt.executeUpdate());
    cstmt.setInt("id",10);
    cstmt.setObject("d",testLocalDate,JDBCType.DATE,10);
    cstmt.setObject("t",testLocalTime,JDBCType.TIME,8);
    cstmt.setObject("dt",testLocalDateTime,JDBCType.TIMESTAMP,20);
    cstmt.setObject("ts",testLocalDateTime,JDBCType.TIMESTAMP,20);
    assertEquals(1,cstmt.executeUpdate());
    cstmt.setInt("id",11);
    cstmt.setObject("d",testLocalDate,JDBCType.VARCHAR);
    cstmt.setObject("t",testLocalTime,JDBCType.VARCHAR);
    cstmt.setObject("dt",testLocalDateTime,JDBCType.VARCHAR);
    cstmt.setObject("ts",testLocalDateTime,JDBCType.VARCHAR);
    assertEquals(1,cstmt.executeUpdate());
    cstmt.setInt("id",12);
    cstmt.setObject("d",testLocalDate,JDBCType.VARCHAR,10);
    cstmt.setObject("t",testLocalTime,JDBCType.VARCHAR,8);
    cstmt.setObject("dt",testLocalDateTime,JDBCType.VARCHAR,20);
    cstmt.setObject("ts",testLocalDateTime,JDBCType.VARCHAR,20);
    assertEquals(1,cstmt.executeUpdate());
    return 12;
  }
  return 6;
}

private int insertTestDataLocalDTTypes ( PreparedStatement pstmt ) throws Exception { pstmt . setInt ( 1 , 1 ) ; pstmt . setDate ( 2 , testSqlDate ) ; pstmt . setTime ( 3 , testSqlTime ) ; pstmt . setTimestamp ( 4 , testSqlTimeStamp ) ; pstmt . setTimestamp ( 5 , testSqlTimeStamp ) ; assertEquals ( 1 , pstmt . executeUpdate ( ) ) ; pstmt . setInt ( 1 , 2 ) ; pstmt . setObject ( 2 , testLocalDate ) ; pstmt . setObject ( 3 , testLocalTime ) ; pstmt . setObject ( 4 , testLocalDateTime ) ; pstmt . setObject ( 5 , testLocalDateTime ) ; assertEquals ( 1 , pstmt . executeUpdate ( ) ) ; pstmt . setInt ( 1 , 3 ) ; pstmt . setObject ( 2 , testLocalDate , JDBCType . DATE ) ; pstmt . setObject ( 3 , testLocalTime , JDBCType . TIME ) ; pstmt . setObject ( 4 , testLocalDateTime , JDBCType . TIMESTAMP ) ; pstmt . setObject ( 5 , testLocalDateTime , JDBCType . TIMESTAMP ) ; assertEquals ( 1 , pstmt . executeUpdate ( ) ) ; pstmt . setInt ( 1 , 4 ) ; pstmt . setObject ( 2 , testLocalDate , JDBCType . DATE , 10 ) ; pstmt . setObject ( 3 , testLocalTime , JDBCType . TIME , 8 ) ; pstmt . setObject ( 4 , testLocalDateTime , JDBCType . TIMESTAMP , 20 ) ; pstmt . setObject ( 5 , testLocalDateTime , JDBCType . TIMESTAMP , 20 ) ; assertEquals ( 1 , pstmt . executeUpdate ( ) ) ; pstmt . setInt ( 1 , 5 ) ; pstmt . setObject ( 2 , testLocalDate , JDBCType . VARCHAR ) ; pstmt . setObject ( 3 , testLocalTime , JDBCType . VARCHAR ) ; pstmt . setObject ( 4 , testLocalDateTime , JDBCType . VARCHAR ) ; pstmt . setObject ( 5 , testLocalDateTime , JDBCType . VARCHAR ) ; assertEquals ( 1 , pstmt . executeUpdate ( ) ) ; pstmt . setInt ( 1 , 6 ) ; pstmt . setObject ( 2 , testLocalDate , JDBCType . VARCHAR , 10 ) ; pstmt . setObject ( 3 , testLocalTime , JDBCType . VARCHAR , 8 ) ; pstmt . setObject ( 4 , testLocalDateTime , JDBCType . VARCHAR , 20 ) ; pstmt . setObject ( 5 , testLocalDateTime , JDBCType . VARCHAR , 20 ) ; assertEquals ( 1 , pstmt . executeUpdate ( ) ) ; if ( pstmt instanceof CallableStatement ) { CallableStatement cstmt = ( CallableStatement ) pstmt ; cstmt . setInt ( "id" , 7 ) ; cstmt . setDate ( "d" , testSqlDate ) ; cstmt . setTime ( "t" , testSqlTime ) ; cstmt . setTimestamp ( "dt" , testSqlTimeStamp ) ; cstmt . setTimestamp ( "ts" , testSqlTimeStamp ) ; assertEquals ( 1 , cstmt . executeUpdate ( ) ) ; cstmt . setInt ( "id" , 8 ) ; cstmt . setObject ( "d" , testLocalDate ) ; cstmt . setObject ( "t" , testLocalTime ) ; cstmt . setObject ( "dt" , testLocalDateTime ) ; cstmt . setObject ( "ts" , testLocalDateTime ) ; assertEquals ( 1 , cstmt . executeUpdate ( ) ) ; cstmt . setInt ( "id" , 9 ) ; cstmt . setObject ( "d" , testLocalDate , JDBCType . DATE ) ; cstmt . setObject ( "t" , testLocalTime , JDBCType . TIME ) ; cstmt . setObject ( "dt" , testLocalDateTime , JDBCType . TIMESTAMP ) ; cstmt . setObject ( "ts" , testLocalDateTime , JDBCType . TIMESTAMP ) ; assertEquals ( 1 , cstmt . executeUpdate ( ) ) ; cstmt . setInt ( "id" , 10 ) ; cstmt . setObject ( "d" , testLocalDate , JDBCType . DATE , 10 ) ; cstmt . setObject ( "t" , testLocalTime , JDBCType . TIME , 8 ) ; cstmt . setObject ( "dt" , testLocalDateTime , JDBCType . TIMESTAMP , 20 ) ; cstmt . setObject ( "ts" , testLocalDateTime , JDBCType . TIMESTAMP , 20 ) ; assertEquals ( 1 , cstmt . executeUpdate ( ) ) ; cstmt . setInt ( "id" , 11 ) ; cstmt . setObject ( "d" , testLocalDate , JDBCType . VARCHAR ) ; cstmt . setObject ( "t" , testLocalTime , JDBCType . VARCHAR ) ; cstmt . setObject ( "dt" , testLocalDateTime , JDBCType . VARCHAR ) ; cstmt . setObject ( "ts" , testLocalDateTime , JDBCType . VARCHAR ) ; assertEquals ( 1 , cstmt . executeUpdate ( ) ) ; cstmt . setInt ( "id" , 12 ) ; cstmt . setObject ( "d" , testLocalDate , JDBCType . VARCHAR , 10 ) ; cstmt . setObject ( "t" , testLocalTime , JDBCType . VARCHAR , 8 ) ; cstmt . setObject ( "dt" , testLocalDateTime , JDBCType . VARCHAR , 20 ) ; cstmt . setObject ( "ts" , testLocalDateTime , JDBCType . VARCHAR , 20 ) ; assertEquals ( 1 , cstmt . executeUpdate ( ) ) ; return 12 ; } return 6 ; }
helper method for * setobject * tests . insert data into the given preparedstatement , or any of its subclasses , with the following structure : 1 - ` id ` int 2 - ` d ` date ( or any kind of * char ) 3 - ` t ` time ( or any kind of * char ) 4 - ` dt ` datetime ( or any kind of * char ) 5 - ` ts ` timestamp ( or any kind of * char )
