📄 axiondatabasemetadata.java
字号:
/* * $Id: AxionDatabaseMetaData.java,v 1.17 2003/07/10 22:53:50 rwald Exp $ * ======================================================================= * Copyright (c) 2002-2003 Axion Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The names "Tigris", "Axion", nor the names of its contributors may * not be used to endorse or promote products derived from this * software without specific prior written permission. * * 4. Products derived from this software may not be called "Axion", nor * may "Tigris" or "Axion" appear in their names without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ======================================================================= */package org.axiondb.jdbc;import java.sql.Connection;import java.sql.DatabaseMetaData;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.axiondb.Database;/** * A {@link DatabaseMetaData} implementation. * * @TODO Support currently unsupported JDBC 3 methods. * @version $Revision: 1.17 $ $Date: 2003/07/10 22:53:50 $ * @author Rodney Waldhoff */public class AxionDatabaseMetaData implements DatabaseMetaData { public AxionDatabaseMetaData(AxionConnection conn, Database db) { _connection = conn; _db = db; } //------------------------------------------------------------------------- /** Currently returns "<code>AxionDB</code>". */ public String getDatabaseProductName() throws SQLException { return "AxionDB"; // XXX FIX ME XXX } /** Currently returns "<code>1.0M1</code>". */ public String getDatabaseProductVersion() throws SQLException { return AXION_VERSION; } /** Currently returns "<code>Axion JDBC Driver". */ public String getDriverName() throws SQLException { return "Axion JDBC Driver"; } /** Currently returns "<code>1.0M1</code>". */ public String getDriverVersion() throws SQLException { return AXION_VERSION; } /** Currently returns <code>0</code>. */ public int getDriverMajorVersion() { return DB_MAJOR_VERSION; } /** Currently returns <code>1</code>. */ public int getDriverMinorVersion() { return DB_MINOR_VERSION; } //------------------------------------------------------------------------- /** Currently returns <code>null</code>. */ public String getUserName() throws SQLException { return null; } /** Currently returns <code>false</code>. */ public boolean allProceduresAreCallable() throws SQLException { return false; } /** Returns <code>true</code>, since all tables are indeed selectable. */ public boolean allTablesAreSelectable() throws SQLException { return true; } /** * Returns <code>true</code> when this database is * known to be read only, false otherwise. */ public boolean isReadOnly() throws SQLException { return _db.isReadOnly(); } /** Returns <code>false</code>, since Axion currently ignores case in identifiers. */ public boolean supportsMixedCaseIdentifiers() throws SQLException { return false; } /** Returns <code>true</code>, since Axion supports column aliasing. */ public boolean supportsColumnAliasing() throws SQLException { return true; } /** Returns <code>true</code>, since Axion supports addBatch,clearBatch and executeBatch. */ public boolean supportsBatchUpdates() throws SQLException { return true; } /** Returns my {@link Connection}. */ public Connection getConnection() throws SQLException { return _connection; } /** * Returns <code>true</code>, since <code>null</code>s are * considered greater than any non-<code>null</code> value. */ public boolean nullsAreSortedHigh() throws SQLException { return true; } /** * Returns <code>false</code>, since <code>null</code>s are * considered greater than any non-<code>null</code> value. * @see #nullsAreSortedHigh */ public boolean nullsAreSortedLow() throws SQLException { return false; } /** * Returns <code>false</code>, since <code>null</code>s are * considered greater than any non-<code>null</code> value. * @see #nullsAreSortedHigh */ public boolean nullsAreSortedAtStart() throws SQLException { return false; } /** * Returns <code>false</code>, since <code>null</code>s are * considered greater than any non-<code>null</code> value. * @see #nullsAreSortedHigh */ public boolean nullsAreSortedAtEnd() throws SQLException { return false; } /** * Returns <code>false</code>, since Axion currently * ignores case in identifiers, and stores them internally * as upper case values. */ public boolean storesLowerCaseIdentifiers() throws SQLException { return false; } /** * Returns <code>false</code>, since Axion currently * ignores case in identifiers. */ public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException { return false; } /** * Returns <code>false</code>, since Axion currently * ignores case in identifiers, and stores them internally * as upper case values. */ public boolean storesMixedCaseQuotedIdentifiers() throws SQLException { return false; } /** * Returns <code>true</code>, since Axion currently * ignores case in identifiers, and stores them internally * as upper case values. */ public boolean storesUpperCaseIdentifiers() throws SQLException { return true; } /** * Returns <code>false</code>, since Axion currently * ignores case in identifiers, and stores them internally * as upper case values. Quoted identifiers are also * currently unsupported. */ public boolean storesLowerCaseQuotedIdentifiers() throws SQLException { return false; } /** * Returns <code>false</code>, since Axion currently * ignores case in identifiers, and stores them internally * as upper case values. */ public boolean storesMixedCaseIdentifiers() throws SQLException { return false; } /** * Returns <code>0</code>, since Axion has no hard limit * on the size of a row. */ public int getMaxRowSize() throws SQLException { return 0; } /** * Returns <code>0</code>, since Axion has no hard limit * on the size of a statement. */ public int getMaxStatementLength() throws SQLException { return 0; } /** * Returns <code>0</code>, since Axion has no hard limit * on the number of connections. */ public int getMaxConnections() throws SQLException { return 0; } /** * Returns <code>0</code>, since Axion has no hard limit * on the length of a column name. */ public int getMaxColumnNameLength() throws SQLException { return Integer.MAX_VALUE; } /** * Returns <code>1</code>, since Axion currently doesn't * support multi-column indices. */ public int getMaxColumnsInIndex() throws SQLException { return 1; // 0 when we support multi-column indices } /** * Returns {@link java.lang.Integer#MAX_VALUE}, the * maximum number of tables Axion can manage in a single * SELECT statement. */ public int getMaxTablesInSelect() throws SQLException { return Integer.MAX_VALUE; } /** * Returns {@link java.lang.Integer#MAX_VALUE}, the * maximum number of columns Axion can manage in a single * ORDER BY clause. */ public int getMaxColumnsInOrderBy() throws SQLException { return Integer.MAX_VALUE; } /** * Returns {@link java.lang.Integer#MAX_VALUE}, the * maximum number of columns Axion can manage in a single * SELECT clause. */ public int getMaxColumnsInSelect() throws SQLException { return Integer.MAX_VALUE; } /** * Returns {@link java.lang.Integer#MAX_VALUE}, the * maximum number of columns Axion can manage in a single * table. */ public int getMaxColumnsInTable() throws SQLException { return Integer.MAX_VALUE; } /** * Returns 0. */ public int getMaxColumnsInGroupBy() throws SQLException { return 0; } /** * Returns <code>false</code> since UNION queries are * currently not supported.. */ public boolean supportsUnion() throws SQLException { return false; } /** Returns <code>0</code>. */ public int getMaxSchemaNameLength() throws SQLException { return 0; } /** Returns <code>0</code>. */ public int getMaxStatements() throws SQLException { return 0; } /** Returns <code>Integer.MAX_VALUE</code>. */ public int getMaxTableNameLength() throws SQLException { return Integer.MAX_VALUE; } /** Returns <code>0</code>. */ public int getMaxUserNameLength() throws SQLException { return 0; } /** Returns <code>0</code>. */ public int getMaxBinaryLiteralLength() throws SQLException { return 0; } /** Returns <code>0</code>. */ public int getMaxCharLiteralLength() throws SQLException { return 0; } /** Returns <code>0</code>. */ public int getMaxIndexLength() throws SQLException { return 0; } /** Returns <code>0</code>. */ public int getMaxProcedureNameLength() throws SQLException { return 0; } /** Returns <code>0</code>. */ public int getMaxCatalogNameLength() throws SQLException { return 0; } /** Returns {@link Connection#TRANSACTION_SERIALIZABLE}. */ public int getDefaultTransactionIsolation() throws SQLException { return Connection.TRANSACTION_SERIALIZABLE; } /** Returns the connect string used to establish my {@link Connection}. */ public String getURL() throws SQLException { return _connection.getURL(); } /** Returns <code>false</code> as this feature is currently not supported. */ public boolean supportsSelectForUpdate() throws SQLException { return false; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -