jdbc: Get the SQL Type Name from java.sql.Type code

前端 未结 8 1046
情歌与酒
情歌与酒 2021-02-01 14:56

I have an array with Field Names and jdbc Type codes. (Those int codes that you can find in

http://download.oracle.com/javase/1.4.2/docs/api/constant-values.html#java.s

8条回答
  •  星月不相逢
    2021-02-01 15:41

    The Apache DdlUtils Library has a convenience class for this: https://db.apache.org/ddlutils/api/org/apache/ddlutils/model/TypeMap.html

    String typeName = TypeMap.getJdbcTypeName(typeCode)
    

    The library helps you also with other DDL needs, but doesn't seem to get much attention lately.

提交回复
热议问题