@Test public void switchCharTypeTest () { Assert.assertEquals (Types.CHAR, TypeMap.switchCharType (Types.NCHAR)); Assert.assertEquals (Types.NCHAR, TypeMap.switchCharType (Types.CHAR)); Assert.assertEquals (Types.VARCHAR, TypeMap.switchCharType (Types.NVARCHAR)); Assert.assertEquals (Types.NVARCHAR, TypeMap.switchCharType (Types.VARCHAR)); Assert.assertEquals (Types.LONGVARCHAR, TypeMap.switchCharType (Types.LONGNVARCHAR)); Assert.assertEquals (Types.LONGNVARCHAR, TypeMap.switchCharType (Types.LONGVARCHAR)); Assert.assertEquals (Types.CLOB, TypeMap.switchCharType (Types.NCLOB)); Assert.assertEquals (Types.NCLOB, TypeMap.switchCharType (Types.CLOB)); Assert.assertEquals (Types.BLOB, TypeMap.switchCharType (Types.BLOB)); }
static int switchCharType (int type) { switch (type) { case Types.CHAR: return Types.NCHAR; case Types.VARCHAR: return Types.NVARCHAR; case Types.LONGVARCHAR: return Types.LONGNVARCHAR; case Types.CLOB: return Types.NCLOB; case Types.NCHAR: return Types.CHAR; case Types.NVARCHAR: return Types.VARCHAR; case Types.LONGNVARCHAR: return Types.LONGVARCHAR; case Types.NCLOB: return Types.CLOB; } return type; }
TypeMap { static int switchCharType (int type) { switch (type) { case Types.CHAR: return Types.NCHAR; case Types.VARCHAR: return Types.NVARCHAR; case Types.LONGVARCHAR: return Types.LONGNVARCHAR; case Types.CLOB: return Types.NCLOB; case Types.NCHAR: return Types.CHAR; case Types.NVARCHAR: return Types.VARCHAR; case Types.LONGNVARCHAR: return Types.LONGVARCHAR; case Types.NCLOB: return Types.CLOB; } return type; } }
TypeMap { static int switchCharType (int type) { switch (type) { case Types.CHAR: return Types.NCHAR; case Types.VARCHAR: return Types.NVARCHAR; case Types.LONGVARCHAR: return Types.LONGNVARCHAR; case Types.CLOB: return Types.NCLOB; case Types.NCHAR: return Types.CHAR; case Types.NVARCHAR: return Types.VARCHAR; case Types.LONGNVARCHAR: return Types.LONGVARCHAR; case Types.NCLOB: return Types.CLOB; } return type; } TypeMap(Map<Integer, TypeInfo> map); }
TypeMap { static int switchCharType (int type) { switch (type) { case Types.CHAR: return Types.NCHAR; case Types.VARCHAR: return Types.NVARCHAR; case Types.LONGVARCHAR: return Types.LONGNVARCHAR; case Types.CLOB: return Types.NCLOB; case Types.NCHAR: return Types.CHAR; case Types.NVARCHAR: return Types.VARCHAR; case Types.LONGNVARCHAR: return Types.LONGVARCHAR; case Types.NCLOB: return Types.CLOB; } return type; } TypeMap(Map<Integer, TypeInfo> map); TypeInfo getType(int type, int precision, boolean exact); void setCustomMap(Map<Integer, TypeInfo> customMap); String getTypeName(int type, int precision, int scale, boolean exact); static boolean isSameType(String src, String sub); }
TypeMap { static int switchCharType (int type) { switch (type) { case Types.CHAR: return Types.NCHAR; case Types.VARCHAR: return Types.NVARCHAR; case Types.LONGVARCHAR: return Types.LONGNVARCHAR; case Types.CLOB: return Types.NCLOB; case Types.NCHAR: return Types.CHAR; case Types.NVARCHAR: return Types.VARCHAR; case Types.LONGNVARCHAR: return Types.LONGVARCHAR; case Types.NCLOB: return Types.CLOB; } return type; } TypeMap(Map<Integer, TypeInfo> map); TypeInfo getType(int type, int precision, boolean exact); void setCustomMap(Map<Integer, TypeInfo> customMap); String getTypeName(int type, int precision, int scale, boolean exact); static boolean isSameType(String src, String sub);  }