搜索
首页 电脑/网络 软件 系统软件

java获取数据库字段名方法是什么呢?

java获取数据库字段名方法是什么呢?

全部回答

2018-04-08

56 0
    ResultSetMetaData metaDate = rs。getMetaData(); int number = metaDate。getColumnCount(); String[] column = new String[number]; for (int j = 0; j < column。
    length; j++) { column[j] = metaDate。getColumnName(j + 1); } //将字段名保存到数组column中 String getCatalogName(int column) Gets the designated column’s table’s catalog name。
     String getColumnClassName(int column) Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet。
    getObject is called to retrieve a value from the column。 int getColumnCount() Returns the number of columns in this ResultSet object。
     int getColumnDisplaySize(int column) Indicates the designated column’s normal maximum width in characters。
   String getColumnLabel(int column) Gets the designated column’s suggested title for use in printouts and displays。
     String getColumnName(int column) Get the designated column’s name。 int getColumnType(int column) Retrieves the designated column’s SQL type。
     String getColumnTypeName(int column) Retrieves the designated column’s database-specific type name。
   int getPrecision(int column) Get the designated column’s number of decimal digits。   int getScale(int column) Gets the designated column’s number of digits to right of the decimal point。
   String getSchemaName(int column) Get the designated column’s table’s schema。   String getTableName(int column) Gets the designated column’s table name。
  

类似问题换一批

热点推荐

热度TOP

相关推荐
加载中...

热点搜索 换一换

电脑/网络
系统软件
硬件
电脑装机
程序设计
互联网
操作系统/系统故障
笔记本电脑
反病毒
百度
软件
软件
系统软件
多媒体软件
办公软件
网络软件
图像处理软件
系统软件
系统软件
举报
举报原因(必选):
取消确定举报