/** For each (source, destination) type, make sure that we can convert bind variables. */
 @Test
 public void testParameterConvert() throws Exception {
   final StringBuilder sql = new StringBuilder("select 1");
   final Map<SqlType, Integer> map = Maps.newHashMap();
   for (Map.Entry<Class, SqlType> entry : SqlType.getSetConversions()) {
     final SqlType sqlType = entry.getValue();
     switch (sqlType) {
       case BIT:
       case LONGVARCHAR:
       case LONGVARBINARY:
       case NCHAR:
       case NVARCHAR:
       case LONGNVARCHAR:
       case BLOB:
       case CLOB:
       case NCLOB:
       case ARRAY:
       case REF:
       case STRUCT:
       case DATALINK:
       case ROWID:
       case JAVA_OBJECT:
       case SQLXML:
         continue;
     }
     if (!map.containsKey(sqlType)) {
       sql.append(", cast(? as ").append(sqlType).append(")");
       map.put(sqlType, map.size() + 1);
     }
   }
   sql.append(" from (values 1)");
   final PreparedStatement statement = localConnection.prepareStatement(sql.toString());
   for (Map.Entry<SqlType, Integer> entry : map.entrySet()) {
     statement.setNull(entry.getValue(), entry.getKey().id);
   }
   for (Map.Entry<Class, SqlType> entry : SqlType.getSetConversions()) {
     final SqlType sqlType = entry.getValue();
     if (!map.containsKey(sqlType)) {
       continue;
     }
     int param = map.get(sqlType);
     Class clazz = entry.getKey();
     for (Object sampleValue : values(sqlType.boxedClass())) {
       switch (sqlType) {
         case DATE:
         case TIME:
         case TIMESTAMP:
           continue; // FIXME
       }
       if (clazz == Calendar.class) {
         continue; // FIXME
       }
       final Object o;
       try {
         o = convert(sampleValue, clazz);
       } catch (IllegalArgumentException | ParseException e) {
         continue;
       }
       out.println(
           "check "
               + o
               + " (originally "
               + sampleValue.getClass()
               + ", now "
               + o.getClass()
               + ") converted to "
               + sqlType);
       if (o instanceof Double && o.equals(Double.POSITIVE_INFINITY)
           || o instanceof Float && o.equals(Float.POSITIVE_INFINITY)) {
         continue;
       }
       statement.setObject(param, o, sqlType.id);
       final ResultSet resultSet = statement.executeQuery();
       assertThat(resultSet.next(), is(true));
       out.println(resultSet.getString(param + 1));
     }
   }
   statement.close();
 }