⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showdatabasemetadata.java

📁 本套光盘提供了本书各章实例的所需的部分源程序文件以及数据库文件。读者 需要使用JDK 1.4(必需)版
💻 JAVA
字号:
import java.sql.*;

public class ShowDatabaseMetaData {
  public static void main(String[] args) {
    Connection conn = null;

    try {
      conn = ConnectionManager.getConnection();
      DatabaseMetaData md = conn.getMetaData();

      System.out.println("Information about the database: ");
      System.out.println("Database name=[" + md.getDatabaseProductName() 
                         + "]");
      System.out.println("Database version=[" 
                         + md.getDatabaseProductVersion() + "]");
      System.out.println("Driver name=[" + md.getDriverName() + "]");
      System.out.println("Driver version=[" + md.getDriverVersion() 
                         + "]");

      System.out
        .println("Supports forward only ResultSet=[" 
                 + md.supportsResultSetType(ResultSet.TYPE_FORWARD_ONLY) 
                 + "]");
      System.out
        .println("Supports scroll sensitive ResultSet=[" 
                 + md.supportsResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE) 
                 + "]");
      System.out
        .println("Supports scroll insensitive ResultSet=[" 
                 + md.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE) 
                 + "]");

      System.out
        .println("Supports updatable ResultSet=[" 
                 + md.supportsResultSetConcurrency(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE) 
                 + "]");
      System.out.println("Supports ANSI92 entry=[" 
                         + md.supportsANSI92EntryLevelSQL() + "]");
      System.out.println("Supports ANSI92 intermediate=[" 
                         + md.supportsANSI92IntermediateSQL() + "]");
      System.out.println("Supports ANSI92 full=[" 
                         + md.supportsANSI92FullSQL() + "]");
    } catch (Exception e) {
      e.printStackTrace();
    } 
    finally {
      ConnectionManager.close(conn);
    } 
  } 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -