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

📄 jdbcdatabasemetadata.java

📁 一个可以在applet窗体上持行sql语句并显示返回结果的程序
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
/*
 * jdbcDatabaseMetaData.java
 */

package org.hsql;
import java.sql.*;

/**
 * Comprehensive information about the database as a whole.
 *
 * <P>Many of the methods here return lists of information in
 * the form of <code>ResultSet</code> objects.
 * You can use the normal ResultSet methods such as getString and getInt
 * to retrieve the data from these ResultSets. If a given form of
 * metadata is not available, these methods should throw an SQLException.
 *
 * <P>Some of these methods take arguments that are String patterns.  These
 * arguments all have names such as fooPattern.  Within a pattern String, "%"
 * means match any substring of 0 or more characters, and "_" means match
 * any one character. Only metadata entries matching the search pattern
 * are returned. If a search pattern argument is set to a null ref,
 * that argument's criteria will be dropped from the search.
 *
 * <P>An <code>SQLException</code> will be thrown if a driver does not support
 * a meta data method.  In the case of methods that return a ResultSet,
 * either a ResultSet (which may be empty) is returned or a
 * SQLException is thrown.
 */
public class jdbcDatabaseMetaData implements DatabaseMetaData {
  private jdbcConnection cConnection;

  jdbcDatabaseMetaData(jdbcConnection c) {
    cConnection=c;
  }

  /**
   * Can all the procedures returned by getProcedures be called by the
   * current user?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean allProceduresAreCallable() {
    if(Trace.TRACE) Trace.trace();
    return true;
  }
  /**
   * Can all the tables returned by getTable be SELECTed by the
   * current user?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean allTablesAreSelectable() {
    if(Trace.TRACE) Trace.trace();
    return true;
  }
  /**
   * What's the url for this database?
   *
   * @return the url
   */
  public String getURL() {
    if(Trace.TRACE) Trace.trace();
    return "jdbc:HypersonicSQL:"+cConnection.getName();
  }
  /**
   * What's our user name as known to the database?
   *
   * @return our database user name
   * @exception SQLException if a database access error occurs
   */
  public String getUserName() throws SQLException {
    if(Trace.TRACE) Trace.trace();
    ResultSet r=executeSelect("SYSTEM_CONNECTIONINFO","KEY='USER'");
    r.next();
    return r.getString(2);
  }
  /**
   * Is the database in read-only mode?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   * @exception SQLException if a database access error occurs
   */
  public boolean isReadOnly() throws SQLException {
    if(Trace.TRACE) Trace.trace();
    return cConnection.isReadOnly();
  }
  /**
   * Are NULL values sorted high?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean nullsAreSortedHigh() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Are NULL values sorted low?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean nullsAreSortedLow() {
    if(Trace.TRACE) Trace.trace();
    return true;
  }
  /**
   * Are NULL values sorted at the start regardless of sort order?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean nullsAreSortedAtStart() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Are NULL values sorted at the end regardless of sort order?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean nullsAreSortedAtEnd() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * What's the name of this database product?
   *
   * @return database product name
   */
  public String getDatabaseProductName() {
    if(Trace.TRACE) Trace.trace();
    return jdbcDriver.PRODUCT;
  }
  /**
   * What's the version of this database product?
   *
   * @return database version
   */
  public String getDatabaseProductVersion() {
    if(Trace.TRACE) Trace.trace();
    return jdbcDriver.VERSION;
  }
  /**
   * What's the name of this JDBC driver?
   *
   * @return JDBC driver name
   */
  public String getDriverName() {
    if(Trace.TRACE) Trace.trace();
    return jdbcDriver.PRODUCT+" Driver";
  }
  /**
   * What's the version of this JDBC driver?
   *
   * @return JDBC driver version
   */
  public String getDriverVersion() {
    if(Trace.TRACE) Trace.trace();
    return jdbcDriver.VERSION;
  }
  /**
   * What's this JDBC driver's major version number?
   *
   * @return JDBC driver major version
   */
  public int getDriverMajorVersion() {
    if(Trace.TRACE) Trace.trace();
    return jdbcDriver.MAJOR;
  }
  /**
   * What's this JDBC driver's minor version number?
   *
   * @return JDBC driver minor version number
   */
  public int getDriverMinorVersion() {
    if(Trace.TRACE) Trace.trace();
    return jdbcDriver.MINOR;
  }
  /**
   * Does the database store tables in a local file?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean usesLocalFiles() {
    if(Trace.TRACE) Trace.trace();
    return cConnection.usesLocalFiles();
  }
  /**
   * Does the database use a file for each table?
   *
   * @return true if the database uses a local file for each table
   */
  public boolean usesLocalFilePerTable() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Does the database treat mixed case unquoted SQL identifiers as
   * case sensitive and as a result store them in mixed case?
   *
   * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver will
   * always return false.
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean supportsMixedCaseIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Does the database treat mixed case unquoted SQL identifiers as
   * case insensitive and store them in upper case?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean storesUpperCaseIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return true;
  }
  /**
   * Does the database treat mixed case unquoted SQL identifiers as
   * case insensitive and store them in lower case?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean storesLowerCaseIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Does the database treat mixed case unquoted SQL identifiers as
   * case insensitive and store them in mixed case?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean storesMixedCaseIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Does the database treat mixed case quoted SQL identifiers as
   * case sensitive and as a result store them in mixed case?
   *
   * A JDBC Compliant<sup><font size=-2>TM</font></sup> driver will
   * always return true.
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean supportsMixedCaseQuotedIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return true;
    // InterBase (iscdrv32.dll) returns false
  }
  /**
   * Does the database treat mixed case quoted SQL identifiers as
   * case insensitive and store them in upper case?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean storesUpperCaseQuotedIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Does the database treat mixed case quoted SQL identifiers as
   * case insensitive and store them in lower case?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean storesLowerCaseQuotedIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return false;
  }
  /**
   * Does the database treat mixed case quoted SQL identifiers as
   * case insensitive and store them in mixed case?
   *
   * @return <code>true</code> if so; <code>false</code> otherwise
   */
  public boolean storesMixedCaseQuotedIdentifiers() {
    if(Trace.TRACE) Trace.trace();
    return false;
    // No: as case sensitive.
  }
  /**
   * What's the string used to quote SQL identifiers?
   * This returns a space " " if identifier quoting isn't supported.
   *
   * A JDBC Compliant<sup><font size=-2>TM</font></sup>
	 * driver always uses a double quote character.
   *
   * @return the quoting string
   */
  public String getIdentifierQuoteString() {
    if(Trace.TRACE) Trace.trace();
    return "\"";
    // InterBase (iscdrv32.dll) returns ""
  }
  /**
   * Gets a comma-separated list of all a database's SQL keywords
   * that are NOT also SQL92 keywords.
   *
   * @return the list
   */
  public String getSQLKeywords() {
    if(Trace.TRACE) Trace.trace();
    return "";
  }
  /**
   * Gets a comma-separated list of math functions.  These are the
   * X/Open CLI math function names used in the JDBC function escape
   * clause.
   *
   * @return the list
   */
  public String getNumericFunctions() {
    if(Trace.TRACE) Trace.trace();
    return getList(Library.sNumeric);
  }
  /**
   * Gets a comma-separated list of string functions.  These are the
   * X/Open CLI string function names used in the JDBC function escape
   * clause.
   *
   * @return the list
   */
  public String getStringFunctions() {
    if(Trace.TRACE) Trace.trace();
    return getList(Library.sString);
  }
  /**
   * Gets a comma-separated list of system functions.  These are the
   * X/Open CLI system function names used in the JDBC function escape
   * clause.
   *
   * @return the list
   */
  public String getSystemFunctions() {
    if(Trace.TRACE) Trace.trace();
    return getList(Library.sSystem);
  }
  /**
   * Gets a comma-separated list of time and date functions.
   *
   * @return the list
   */
  public String getTimeDateFunctions() {
    if(Trace.TRACE) Trace.trace();
    return getList(Library.sTimeDate);
  }
  /**
	 * Gets the string that can be used to escape wildcard characters.
   * This is the string that can be used to escape '_' or '%' in
   * the string pattern style catalog search parameters.
   *
   * <P>The '_' character represents any single character.
   * <P>The '%' character represents any sequence of zero or
   * more characters.
   *
   * @return the string used to escape wildcard characters
   */
  public String getSearchStringEscape() {
    if(Trace.TRACE) Trace.trace();
    return "\\";
  }
  /**
   * Gets all the "extra" characters that can be used in unquoted
   * identifier names (those beyond a-z, A-Z, 0-9 and _).
   *
   * @return the string containing the extra characters
   */
  public String getExtraNameCharacters() {
    if(Trace.TRACE) Trace.trace();
    return "";
  }
  /**

⌨️ 快捷键说明

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