本文整理汇总了Java中org.hsqldb.types.Type.getNameString方法的典型用法代码示例。如果您正苦于以下问题:Java Type.getNameString方法的具体用法?Java Type.getNameString怎么用?Java Type.getNameString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.types.Type
的用法示例。
在下文中一共展示了Type.getNameString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColumnInType
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* Internal value converter. Similar to its counterpart in JDBCResultSet <p>
*
* All trivially successful getXXX methods eventually go through this
* method, converting if necessary from the source type to the
* requested type. <p>
*
* Conversion to the JDBC representation, if different, is handled by the
* calling methods.
*
* @param columnIndex of the column value for which to perform the
* conversion
* @param targetType the org.hsqldb.types.Type object for targetType
* @return an Object of the requested targetType, representing the value of the
* specified column
* @throws SQLException when there is no rowData, the column index is
* invalid, or the conversion cannot be performed
*/
private Object getColumnInType(int columnIndex,
Type targetType) throws SQLException {
checkGetParameterIndex(columnIndex);
Type sourceType;
Object value;
sourceType = parameterTypes[--columnIndex];
value = parameterValues[columnIndex];
if (trackNull(value)) {
return null;
}
if (sourceType.typeCode != targetType.typeCode) {
try {
value = targetType.convertToTypeJDBC(session, value,
sourceType);
} catch (HsqlException e) {
String stringValue =
(value instanceof Number || value instanceof String
|| value instanceof java.util.Date) ? value.toString()
: "instance of " + value.getClass().getName();
String msg = "from SQL type " + sourceType.getNameString()
+ " to " + targetType.getJDBCClassName()
+ ", value: " + stringValue;
HsqlException err = Error.error(ErrorCode.X_42561, msg);
throw JDBCUtil.sqlException(err, e);
}
}
return value;
}
示例2: getColumnInType
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* Internal value converter. Similar to its counterpart in JDBCResultSet <p>
*
* All trivially successful getXXX methods eventually go through this
* method, converting if neccessary from the source type to the
* requested type. <p>
*
* Conversion to the JDBC representation, if different, is handled by the
* calling methods.
*
* @param columnIndex of the column value for which to perform the
* conversion
* @param targetType the org.hsqldb.types.Type object for targetType
* @return an Object of the requested targetType, representing the value of the
* specified column
* @throws SQLException when there is no rowData, the column index is
* invalid, or the conversion cannot be performed
*/
private Object getColumnInType(int columnIndex,
Type targetType) throws SQLException {
Type sourceType;
Object value;
sourceType = parameterTypes[--columnIndex];
value = parameterValues[columnIndex];
if (trackNull(value)) {
return null;
}
if (sourceType.typeCode != targetType.typeCode) {
try {
value = targetType.convertToTypeJDBC(session, value,
sourceType);
} catch (HsqlException e) {
String stringValue =
(value instanceof Number || value instanceof String
|| value instanceof java.util.Date) ? value.toString()
: "instance of " + value.getClass().getName();
String msg = "from SQL type " + sourceType.getNameString()
+ " to " + targetType.getJDBCClassName()
+ ", value: " + stringValue;
HsqlException err = Error.error(ErrorCode.X_42561, msg);
throw Util.sqlException(err, e);
}
}
return value;
}
示例3: getColumnInType
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* Internal value converter. <p>
*
* All trivially successful getXXX methods eventually go through this
* method, converting if neccessary from the source type to the
* requested type. <p>
*
* Conversion to the JDBC representation, if different, is handled by the
* calling methods.
*
* @param columnIndex of the column value for which to perform the
* conversion
* @param targetType the org.hsqldb.types.Type object for targetType
* @return an Object of the requested targetType, representing the value of the
* specified column
* @throws SQLException when there is no rowData, the column index is
* invalid, or the conversion cannot be performed
*/
private Object getColumnInType(int columnIndex,
Type targetType) throws SQLException {
Object[] rowData = getCurrent();
Type sourceType;
Object value;
checkColumn(columnIndex);
sourceType = resultMetaData.columnTypes[--columnIndex];
value = rowData[columnIndex];
if (trackNull(value)) {
return null;
}
if (sourceType.typeCode != targetType.typeCode) {
try {
value = targetType.convertToTypeJDBC(session, value,
sourceType);
} catch (Exception e) {
String stringValue = (value instanceof Number
|| value
instanceof String) ? value.toString()
: "instance of " + value.getClass().getName();
String msg = "from SQL type " + sourceType.getNameString()
+ " to " + targetType.getJDBCClassName()
+ ", value: " + stringValue;
Util.throwError(Error.error(ErrorCode.X_42561, msg));
}
}
return value;
}
示例4: getColumnInType
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* Internal value converter. <p>
*
* All trivially successful getXXX methods eventually go through this
* method, converting if neccessary from the source type to the
* requested type. <p>
*
* Conversion to the JDBC representation, if different, is handled by the
* calling methods.
*
* @param columnIndex of the column value for which to perform the
* conversion
* @param targetType the org.hsqldb.types.Type object for targetType
* @return an Object of the requested targetType, representing the value of the
* specified column
* @throws SQLException when there is no rowData, the column index is
* invalid, or the conversion cannot be performed
*/
protected Object getColumnInType(int columnIndex,
Type targetType) throws SQLException {
Object[] rowData = getCurrent();
Type sourceType;
Object value;
checkColumn(columnIndex);
sourceType = resultMetaData.columnTypes[--columnIndex];
value = rowData[columnIndex];
if (trackNull(value)) {
return null;
}
if (translateTTIType && targetType.isIntervalType()) {
targetType = ((IntervalType) targetType).getCharacterType();
}
if (sourceType.typeCode != targetType.typeCode) {
try {
value = targetType.convertToTypeJDBC(session, value,
sourceType);
} catch (Exception e) {
String stringValue = (value instanceof Number
|| value
instanceof String) ? value.toString()
: "instance of " + value.getClass().getName();
String msg = "from SQL type " + sourceType.getNameString()
+ " to " + targetType.getJDBCClassName()
+ ", value: " + stringValue;
JDBCUtil.throwError(Error.error(ErrorCode.X_42561, msg));
}
}
return value;
}
示例5: getColumnTypeName
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* <!-- start generic documentation -->
* Retrieves the designated column's database-specific type name.
* <!-- end generic documentation -->
*
* @param column the first column is 1, the second is 2, ...
* @return type name used by the database. If the column type is
* a user-defined type, then a fully-qualified type name is returned.
* @exception SQLException if a database access error occurs
*/
public String getColumnTypeName(int column) throws SQLException {
checkColumn(column);
Type type = translateType(resultMetaData.columnTypes[--column]);
return type.getNameString();
}
示例6: getParameterTypeName
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* Retrieves the designated parameter's database-specific type name.
*
* @param param the first parameter is 1, the second is 2, ...
* @return type the name used by the database. If the parameter type is
* a user-defined type, then a fully-qualified type name is returned.
* @exception SQLException if a database access error occurs
* @since JDK 1.4, HSQLDB 1.7.2
*/
public String getParameterTypeName(int param) throws SQLException {
checkRange(param);
Type type = translateType(rmd.columnTypes[--param]);
return type.getNameString();
}
示例7: getColumnTypeName
import org.hsqldb.types.Type; //导入方法依赖的package包/类
/**
* <!-- start generic documentation -->
* Retrieves the designated column's database-specific type name.
* <!-- end generic documentation -->
*
* @param column the first column is 1, the second is 2, ...
* @return type name used by the database. If the column type is
* a user-defined type, then a fully-qualified type name is returned.
* @exception SQLException if a database access error occurs
*/
public String getColumnTypeName(int column) throws SQLException {
checkColumn(column);
Type type = resultMetaData.columnTypes[--column];
return type.getNameString();
}