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

📄 ssdatabasemetadata.java

📁 這是一個油Java實作的資料庫系統 是個入門的好材料
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/* =============================================================
 * SmallSQL : a free Java DBMS library for the Java(tm) platform
 * =============================================================
 *
 * (C) Copyright 2004-2007, by Volker Berlin.
 *
 * Project Info:  http://www.smallsql.de/
 *
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License as published by 
 * the Free Software Foundation; either version 2.1 of the License, or 
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.  
 *
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
 * in the United States and other countries.]
 *
 * ---------------
 * SSDatabaseMetaData.java
 * ---------------
 * Author: Volker Berlin
 * 
 */
package smallsql.database;

import java.sql.*;
import java.util.ArrayList;


final class SSDatabaseMetaData implements DatabaseMetaData {
	final private SSConnection con;
	final private SSStatement st;
	
	
    /**
     * @throws SQLException Exception can be throw if the Connection already closed.
     */
    SSDatabaseMetaData(SSConnection con) throws SQLException{
		this.con = con;
		st = new SSStatement(con);
	}
	
    public boolean allProceduresAreCallable() {
    	return true;
    }
	
	
    public boolean allTablesAreSelectable() {
    	return true;
    }
	
	
    public String getURL() throws SQLException {
    	Database database = con.getDatabase(true);
    	if(database == null)
			return SSDriver.URL_PREFIX;
    	return SSDriver.URL_PREFIX + ':' + database.getName();
    }
	
	
    public String getUserName() {
    	return "";
    }
	
	
    public boolean isReadOnly() {
    	return false;
    }
	
	
    public boolean nullsAreSortedHigh() {
		return false;
    }
	
	
    public boolean nullsAreSortedLow() {
		return true;
    }
	
	
    public boolean nullsAreSortedAtStart() {
		return false;
    }
	
	
    public boolean nullsAreSortedAtEnd() {
		return false;
    }
	
	
    public String getDatabaseProductName() {
    	return "SmallSQL Database";
    }
	
	
    public String getDatabaseProductVersion() {
    	return getDriverVersion();
    }
	
	
    public String getDriverName(){
    	return "SmallSQL Driver";
    }
	
	
    public String getDriverVersion() {
    	return getDriverMajorVersion() + "." + SSDriver.drv.getMinorVersion();
    }
	
	
    public int getDriverMajorVersion() {
    	return SSDriver.drv.getMajorVersion();
    }
	
	
    public int getDriverMinorVersion() {
		return SSDriver.drv.getMinorVersion();
    }
	
	
    public boolean usesLocalFiles() {
    	return false;
    }
	
	
    public boolean usesLocalFilePerTable() {
    	return false;
    }
	
	
    public boolean supportsMixedCaseIdentifiers() {
    	return true;
    }
	
	
    public boolean storesUpperCaseIdentifiers() {
    	return false;
    }
	
	
    public boolean storesLowerCaseIdentifiers() {
    	return false;
    }
	
	
    public boolean storesMixedCaseIdentifiers() {
    	return true;
    }
	
	
    public boolean supportsMixedCaseQuotedIdentifiers() {
    	return true;
    }
	
	
    public boolean storesUpperCaseQuotedIdentifiers() {
    	return false;
    }
	
	
    public boolean storesLowerCaseQuotedIdentifiers() {
    	return false;
    }
	
	
    public boolean storesMixedCaseQuotedIdentifiers() {
    	return true;
    }
	
	
    public String getIdentifierQuoteString() {
    	return "\"";
    }
	
	
    public String getSQLKeywords() {
    	return "database,use";
    }
    
    
    private String getFunctions(int from, int to){
		StringBuffer buf = new StringBuffer();
		for(int i=from; i<=to; i++){
			if(i != from) buf.append(',');
			buf.append( SQLTokenizer.getKeyWord(i) );
		}
		return buf.toString();
    }
    
    
    public String getNumericFunctions() {
    	return getFunctions(SQLTokenizer.ABS, SQLTokenizer.TRUNCATE);
    }
    
    
    public String getStringFunctions() {
		return getFunctions(SQLTokenizer.ASCII, SQLTokenizer.UCASE);
    }
    
    
    public String getSystemFunctions() {
		return getFunctions(SQLTokenizer.IFNULL, SQLTokenizer.IIF);
    }
    
    
    public String getTimeDateFunctions() {
		return getFunctions(SQLTokenizer.CURDATE, SQLTokenizer.YEAR);
    }
    
    
    public String getSearchStringEscape() {
    	return "\\";
    }
    
    
    public String getExtraNameCharacters() {
    	return "#$ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
    }
	
	
    public boolean supportsAlterTableWithAddColumn() {
        /**@todo: Implement this java.sql.DatabaseMetaData method*/
        throw new java.lang.UnsupportedOperationException("Method supportsAlterTableWithAddColumn() not yet implemented.");
    }
    public boolean supportsAlterTableWithDropColumn() {
        /**@todo: Implement this java.sql.DatabaseMetaData method*/
        throw new java.lang.UnsupportedOperationException("Method supportsAlterTableWithDropColumn() not yet implemented.");
    }
	
	
    public boolean supportsColumnAliasing() {
    	return true;
    }
	
	
    public boolean nullPlusNonNullIsNull() {
    	return true;
    }
	
	
    public boolean supportsConvert() {
    	return true;
    }
	
	
    public boolean supportsConvert(int fromType, int toType) {
    	return true;
    }
	
	
    public boolean supportsTableCorrelationNames() {
    	return true;
    }
	
	
    public boolean supportsDifferentTableCorrelationNames() {
    	return true;
    }
	
	
    public boolean supportsExpressionsInOrderBy() {
    	return true;
    }
	
	
    public boolean supportsOrderByUnrelated() {
    	return true;
    }
	
	
    public boolean supportsGroupBy() {
    	return true;
    }
	
	
    public boolean supportsGroupByUnrelated() {
    	return true;
    }
	
	
    public boolean supportsGroupByBeyondSelect() {
    	return true;
    }
	
	
    public boolean supportsLikeEscapeClause() {
    	return true;
    }
	
	
    public boolean supportsMultipleResultSets() {
    	return true;
    }
	
	
    public boolean supportsMultipleTransactions() {
    	return true;
    }
	
	
    public boolean supportsNonNullableColumns() {
    	return true;
    }
	
	
    public boolean supportsMinimumSQLGrammar() {
    	return true;
    }
	
	
    public boolean supportsCoreSQLGrammar() {
		return true;
    }
	
	
    public boolean supportsExtendedSQLGrammar() {
    	return true;
    }
	
	
    public boolean supportsANSI92EntryLevelSQL() {
    	return true;
    }
	
	
    public boolean supportsANSI92IntermediateSQL() {
    	return true;
    }
	
	
    public boolean supportsANSI92FullSQL() {
    	return true;
    }
	
	
    public boolean supportsIntegrityEnhancementFacility() {
    	return true;
    }

⌨️ 快捷键说明

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