jdbc:从java.sql.Type代码中获取SQL类型名称 [英] jdbc: Get the SQL Type Name from java.sql.Type code
问题描述
我有一个包含字段名称和jdbc类型代码的数组。
(你可以找到的那些int代码
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 .sql.Types.BIT
我使用的是4级驱动程序。
I use a level 4 Driver.
我可以' t弄清楚如何向驱动程序询问相应的SQL(DDL)类型名称。
它在jdbc和本地方言中很有用。
I can't figure out how to ask the driver for the corresponding SQL (DDL) Type names. It would be useful in jdbc and in native dialects.
我有
(CustomerId,1)
(客户名称,-8)
I have
(CustomerId, 1)
(CustomerName, -8)
我希望
(customerId,INT)
(customerId,VARCHAR(200))
(customerId, INT) (customerId, VARCHAR(200))
我在哪里可以找到帮助我的功能?
我在jython中通过zxJDBC使用jdbc,
所以我可以使用所有java和python DB API 2.0功能。
Where can I find functions that help me with that? I am using jdbc in jython via zxJDBC, so I can use all java and python DB API 2.0 functionality.
推荐答案
您似乎正在使用一些尚未发布的JDBC元数据方法。我相信您所看到的是列al的名称使用JDBC 输入常量从中可以派生列类型。看一下 java.sql API ,详细了解如何获取更多元数据。
You seem to be using some JDBC metadata methods you have not posted. I believe what you are seeing is the name of the column along with the JDBC type constant from which you can derive the column type. Have a look at the java.sql API to read more on how to get more meta data.
这篇关于jdbc:从java.sql.Type代码中获取SQL类型名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!