TABLE_CAT |
String |
The catalog name. |
TABLE_SCHEM |
String |
The table schema name. |
TABLE_NAME |
String |
The table name. |
COLUMN_NAME |
String |
The column name. |
DATA_TYPE |
short |
The SQL data type from java.sql.Types. |
TYPE_NAME |
String |
The name of the data type. |
COLUMN_SIZE |
int |
The precision of the column. |
BUFFER_LENGTH |
int |
Not supported by the JDBC driver. |
DECIMAL_DIGITS |
int |
The scale of the column. |
NUM_PREC_RADIX |
int |
The radix of the column. |
NULLABLE |
int |
Indicates if the column is nullable. It can be one of the following values: columnNoNulls (0) columnNullable (1) columnNullableUnknown (2) |
REMARKS |
String |
The comments associated with the column. 注意:
SQL Server always returns null for this column.
|
COLUMN_DEF |
String |
The default value of the column. |
SQL_DATA_TYPE |
int |
Not supported by the JDBC driver. |
SQL_DATETIME_SUB |
int |
Not supported by the JDBC driver. |
CHAR_OCTET_LENGTH |
int |
The maximum number of bytes in the column. |
ORDINAL_POSITION |
int |
The index of the column within the table. |
IS_NULLABLE |
String |
Indicates if the column allows null values.
|
例子:
public static void executeGetColumns(Connection con) { try { DatabaseMetaData dbmd = con.getMetaData(); ResultSet rs = dbmd.getColumns("AdventureWorks", "Person", "Contact", "FirstName"); ResultSetMetaData rsmd = rs.getMetaData(); // Display the result set data. int cols = rsmd.getColumnCount(); while(rs.next()) { for (int i = 1; i <= cols; i++) { System.out.println(rs.getString(i)); } } rs.close(); } catch (Exception e) { e.printStackTrace(); } }
相关推荐
DatabaseMetaData生成数据库DLL
DatabaseMetaData 接口DatabaseMetaData 接口作为整体提供有关数据库的综合信息。 其中某些方法采用“字符串”自变量作为目录和模式名称。DB2 Everyplace 忽略这些自变量。 此处的某些方法以 ResultSet 对象的...
DatabaseMetaData和ResultSetMetaData就是两个常用的获取数据库元数据相关信息的接口,本文只讲解DatabaseMetaData接口获取元数据的方法。 文章地址:http://blog.csdn.net/chen_zw/article/details/18816599
DatabaseMetaData 接口作为整体提供有关数据库的综合信息。
下面小编就为大家带来一篇java 查询oracle数据库所有表DatabaseMetaData的用法(详解)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
calibre-web 数据库文件metadata.db 下载
calibre 数据库,放在挂载的目录下面; 解决问题:DB location is not valid, please enter correct path
DatabaseMetaData dbmd=con.getMetaData(); //获取DatabaseMetaData实例 System.out.println(dbmd.getDatabaseProductName()); //获取数据库名称 System.out.println(dbmd.getDatabaseProductVersion()); //...
DatabaseMetaData dbmd=con.getMetaData(); //获取DatabaseMetaData实例 System.out.println(dbmd.getDatabaseProductName()); //获取数据库名称 System.out.println(dbmd.getDatabaseProductVersion()); //...
Accessing Database Metadata ?Accessing Parameter Metadata from a PreparedStatement Object ?Catching Exceptions ?Debug Tracing with MySQL Connector/C++ ?For More Information ?About the author ?Appendix...
jdbc: 1.数据库连接的方式: ODBC:开放式数据库连接。 C语言实现的,提供语言和(基于SQL的)数据库进行交互的“一致性”的接口 JDBC:java版本的ODBC JDBC连接数据库的步骤: 1.... 1.... 2....
在公司做项目,特别是业务系统的时候,大量的表单和增删改查,而且后台Ui经常用一些easyui等...jdbc DatabaseMetaData(连接数据库 读取表结构) freemarker (根据订制的模版生成 文件) 美化swing界面 substance 皮肤包
jTDS是一个开放源代码的100%纯Java实现的JDBC3.0驱动, 它用于连接 Microsoft SQL Server(6.5,7,2000,2005,2008 和 ...而且实现了所有的数据库元数据(Database MetaData)和结果集元数据(ResultSet MetaData)方法。
DatabaseMetaData metaData=conn.getMetaData(); int dataCount=metaData.getMaxConnections(); //writerLog("数据库最大连接数为:"+dataCount); if(dataCount>0&&maxCount>dataCount){ ...
Chapter 1 introduces the technology and explains the use of database metadata and its role in code generation. Chapter 2 explains Reflection, which is needed to examine the internals of a compiled ...
JTDS完全与JDBC 3.0兼容,支持只向前的,和可滚动/可更新的结果集(ResultSets)中并行(完全独立)语句,并且可实施所有databasemetadata和resultsetmetadata方法。 文件有说明spring+hibernate+c3p0+jtds的配置
利用DatabaseMetaData接口提供关于DBMS的描述性信息,从而使应用程序能适应每个DBMS。 b.可在现有数据库上实现。 c.提供与其它Java系统一致的界面。这说明开发人员可以采用一致的编程界面来处理数据库编程。 d...
利用DatabaseMetaData接口提供关于DBMS的描述性信息,从而使应用程序能适应每个DBMS。 b.可在现有数据库上实现。 c.提供与其它Java系统一致的界面。这说明开发人员可以采用一致的编程界面来处理数据库编程。 d...
Firebird Maestro provides you with a number of tools for working with database metadata and SQL scripts, including code folding. Security management Firebird Maestro provides you with an efficient ...
ZeosDBO is a database middleware components for Borland development ... TZSQLMetadata: Specialized TDataset component which provides an access to database metadata such as tables, columns, indices, etc.