mysql 中的db是啥意思_数据库中的表段名/字段名分别是啥意思

c27b84459a3208d18f6ae818ec32b02b.png

2017-07-28

Java获得数据库字段名方法是什么呢?

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 ta...全部

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。

收起

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值