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

前端 未结 8 1025
情歌与酒
情歌与酒 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:56

    I was also searching for SqlType and i found it in this sourcecode
    http://www.docjar.com/html/api/java/sql/Types.java.html

    0 讨论(0)
  • 2021-02-01 15:58

    You need the ResultSetMetaData object of your current ResultSet. You can get it with getMetaData(). Iterate over the columns and call foreach column the method

    1. getColumnType(i)
    2. getColumnClassName(i)
    3. getColumnTypeName(i)

    of your ResultSetMetaData.

    i represents the column number (starting by 1).

    0 讨论(0)
提交回复
热议问题