当前位置: 首页>>代码示例>>Java>>正文


Java UnsupportedDataType类代码示例

本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.sql.types.UnsupportedDataType的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedDataType类的具体用法?Java UnsupportedDataType怎么用?Java UnsupportedDataType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UnsupportedDataType类属于de.fuberlin.wiwiss.d2rq.sql.types包,在下文中一共展示了UnsupportedDataType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDataType

import de.fuberlin.wiwiss.d2rq.sql.types.UnsupportedDataType; //导入依赖的package包/类
@Override
public DataType getDataType(int jdbcType, String name, int size) {

	// Doesn't support DISTINCT over LOB types
	if (jdbcType == Types.CLOB || "NCLOB".equals(name)) {
		return new SQLCharacterString(this, name, false);
	}
	if (jdbcType == Types.BLOB) {
		return new SQLBinary(this, name, false);
	}
	
	// HSQLDB 2.2.8 reports INTERVAL types as VARCHAR 
	if (jdbcType == Types.VARCHAR && name.startsWith("INTERVAL")) {
		return new SQLInterval(this, name);
	}
	
	// HSQLDB supports NaN and +/-INF in DOUBLE
	if (jdbcType == Types.DOUBLE || jdbcType == Types.FLOAT || jdbcType == Types.REAL) {
		return new HSQLDBCompatibilityDoubleDataType(this);
	}
	
   	// OTHER in HSQLDB 2.2.8 is really JAVA_OBJECT
	if (jdbcType == Types.OTHER) {
		return new UnsupportedDataType(jdbcType, name);
	}

	return super.getDataType(jdbcType, name, size);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:29,代码来源:HSQLDB.java

示例2: getDataType

import de.fuberlin.wiwiss.d2rq.sql.types.UnsupportedDataType; //导入依赖的package包/类
@Override
public DataType getDataType(int jdbcType, String name, int size) {
	
	// Doesn't support DISTINCT over LOB types
	if (jdbcType == Types.CLOB || "NCLOB".equals(name)) {
		return new SQLCharacterString(this, name, false);
	}
	if (jdbcType == Types.BLOB) {
		return new SQLBinary(this, name, false);
	}
	
	DataType standard = super.getDataType(jdbcType, name, size);
	if (standard != null) return standard;

	// Special handling for TIMESTAMP(x) WITH LOCAL TIME ZONE
	if (name.contains("WITH LOCAL TIME ZONE") || "TIMESTAMPLTZ".equals(name)) {
		return new OracleCompatibilityTimeZoneLocalDataType(this, name);
	}
	
	// Special handling for TIMESTAMP(x) WITH TIME ZONE
	if(name.contains("WITH TIME ZONE") || "TIMESTAMPTZ".equals(name)) {
		return new OracleCompatibilityTimeZoneDataType(this, name);
	}
	
	// Oracle-specific character string types
	if ("VARCHAR2".equals(name) || "NVARCHAR2".equals(name)) {
		return new SQLCharacterString(this, name, true);
	}

	// Oracle-specific floating point types
   	if ("BINARY_FLOAT".equals(name) || "BINARY_DOUBLE".equals(name)) {
   		return new SQLApproximateNumeric(this, name);
   	}
   	
	// Oracle binary file pointer
	// TODO: We could at least support reading from BFILE, although querying for them seems hard
   	if ("BFILE".equals(name)) {
   		return new UnsupportedDataType(jdbcType, name);
   	}

   	return null;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:43,代码来源:Oracle.java

示例3: getDataType

import de.fuberlin.wiwiss.d2rq.sql.types.UnsupportedDataType; //导入依赖的package包/类
public DataType getDataType(int jdbcType, String name, int size) {
	// TODO: These are in java.sql.Types as of Java 6 but not yet in Java 1.5
	if ("NCHAR".equals(name) || "NVARCHAR".equals(name) || "NCLOB".equals(name)) {
		return new SQLCharacterString(this, name, true);
	}

	
	switch (jdbcType) {
	case Types.CHAR:
	case Types.VARCHAR:
	case Types.LONGVARCHAR:
	case Types.CLOB:
		return new SQLCharacterString(this, name, true);
		
	case Types.BOOLEAN:
		return new SQLBoolean(this, name);

	case Types.BINARY:
	case Types.VARBINARY:
	case Types.LONGVARBINARY:
	case Types.BLOB:
		return new SQLBinary(this, name, true);
		
	case Types.BIT:
		return new SQLBit(this, name);

	case Types.NUMERIC:
	case Types.DECIMAL:
	case Types.TINYINT:
	case Types.SMALLINT:
	case Types.INTEGER:
	case Types.BIGINT:
		return new SQLExactNumeric(this, name, jdbcType, false);
		
	case Types.REAL:
	case Types.FLOAT:
	case Types.DOUBLE:
		return new SQLApproximateNumeric(this, name);
	
	case Types.DATE:
		return new SQLDate(this, name);
		
	case Types.TIME:
		return new SQLTime(this, name);
		
	case Types.TIMESTAMP:
		return new SQLTimestamp(this, name);

	case Types.ARRAY:
	case Types.JAVA_OBJECT:
		return new UnsupportedDataType(jdbcType, name);
		
	// TODO: What about the remaining java.sql.Types?
	case Types.DATALINK:
	case Types.DISTINCT:
	case Types.NULL:
	case Types.OTHER:
	case Types.REF:
	}
	
	return null;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:63,代码来源:SQL92.java


注:本文中的de.fuberlin.wiwiss.d2rq.sql.types.UnsupportedDataType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。