• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JavaObjectData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getObject

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
/**
 * <!-- start generic documentation -->
 *
 * Retrieves the value of the designated parameter as an <code>Object</code>
 * in the Java programming language. If the value is an SQL <code>NULL</code>,
 * the driver returns a Java <code>null</code>.
 * <p>
 * This method returns a Java object whose type corresponds to the JDBC
 * type that was registered for this parameter using the method
 * <code>registerOutParameter</code>.  By registering the target JDBC
 * type as <code>java.sql.Types.OTHER</code>, this method can be used
 * to read database-specific abstract data types.
 *
 * <!-- end generic documentation -->
 *
 * <!-- start release-specific documentation -->
 * <div class="ReleaseSpecificDocumentation">
 * <h3>HSQLDB-Specific Information:</h3> <p>
 *
 * HSQLDB supports this feature. <p>
 *
 * </div>
 * <!-- end release-specific documentation -->
 *
 * @param parameterIndex the first parameter is 1, the second is 2,
 *        and so on
 * @return A <code>java.lang.Object</code> holding the OUT parameter value
 * @exception SQLException if a database access error occurs or
 * this method is called on a closed <code>CallableStatement</code>
 * @see java.sql.Types
 * @see #setObject
 */
public synchronized Object getObject(
        int parameterIndex) throws SQLException {

    checkGetParameterIndex(parameterIndex);

    Type sourceType = parameterTypes[parameterIndex - 1];

    switch (sourceType.typeCode) {

        case Types.SQL_DATE :
            return getDate(parameterIndex);
        case Types.SQL_TIME :
        case Types.SQL_TIME_WITH_TIME_ZONE :
            return getTime(parameterIndex);
        case Types.SQL_TIMESTAMP :
        case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
            return getTimestamp(parameterIndex);
        case Types.SQL_BINARY :
        case Types.SQL_VARBINARY :
            return getBytes(parameterIndex);
        case Types.OTHER :
        case Types.JAVA_OBJECT : {
            Object o = getColumnInType(parameterIndex, sourceType);

            if (o == null) {
                return null;
            }

            try {
                return ((JavaObjectData) o).getObject();
            } catch (HsqlException e) {
                throw Util.sqlException(e);
            }
        }
        default :
            return getColumnInType(parameterIndex, sourceType);
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:71,代码来源:JDBCCallableStatement.java


示例2: readOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected Object readOther() {

        String s = readString();

        if (s == null) {
            return null;
        }

        BinaryData data = scanner.convertToBinary(s);

        if (data.length(null) == 0) {
            return null;
        }

        return new JavaObjectData(data.getBytes());
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:RowInputText.java


示例3: writeOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected void writeOther(JavaObjectData o) {
    writeByteArray(o.getBytes());
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:4,代码来源:RowOutputBinary.java


示例4: readOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected Object readOther() {

        readFieldPrefix();

        if (scanner.scanNull()) {
            return null;
        }

        scanner.scanBinaryStringWithQuote();

        if (scanner.getTokenType() == Tokens.X_MALFORMED_BINARY_STRING) {
            throw Error.error(ErrorCode.X_42587);
        }

        value = scanner.getValue();

        return new JavaObjectData(((BinaryData) value).getBytes());
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:RowInputTextLog.java


示例5: readOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected Object readOther() {
    return new JavaObjectData(readByteArray());
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:4,代码来源:RowInputBinary.java


示例6: readOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected Object readOther() throws IOException {

        String s = readString();

        if (s == null) {
            return null;
        }

        BinaryData data = scanner.convertToBinary(s);

        if (data.length(null) == 0) {
            return null;
        }

        return new JavaObjectData(data.getBytes());
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:17,代码来源:RowInputText.java


示例7: readOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected Object readOther() throws IOException {

        readFieldPrefix();

        if (scanner.scanNull()) {
            return null;
        }

        scanner.scanBinaryStringWithQuote();

        if (scanner.getTokenType() == Tokens.X_MALFORMED_BINARY_STRING) {
            throw Error.error(ErrorCode.X_42587);
        }

        value = scanner.getValue();

        return new JavaObjectData(((BinaryData) value).getBytes());
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:19,代码来源:RowInputTextLog.java


示例8: readOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected Object readOther() throws IOException {
    return new JavaObjectData(readByteArray());
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:4,代码来源:RowInputBinary.java


示例9: fire

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
public void fire(int type, String name, String tableName, Object[] oldR,
		Object[] newR) {
	UcanaccessConnection conn = UcanaccessConnection.getCtxConnection();
	if (conn.isFeedbackState())
		return;
	try {
		Table t = conn.getDbIO().getTable(tableName);
		if (t == null)
			throw new RuntimeException(
					Logger.getMessage("TABLE_DOESNT_EXIST") + " :"
							+ tableName);
		int i = 0;
		for (Column cl : t.getColumns()) {
			if (cl.isAppendOnly()) {
				ColumnImpl verCol = (ColumnImpl)cl.getVersionHistoryColumn();
				Date upTime = new Date();
				String val = newR[i] == null ? null : newR[i].toString();
				if (type == TriggerBase.INSERT_BEFORE_ROW)
					newR[verCol.getColumnNumber()] = new JavaObjectData(
							new Version[] { new Version(val, upTime) });
				else if (type == TriggerBase.UPDATE_BEFORE_ROW
						&& (oldR[i] != null || newR[i] != null)) {
					if ((oldR[i] == null && newR[i] != null)
							|| (oldR[i] != null && newR[i] == null)
							|| (!oldR[i].equals(newR[i]))) {
						Version[] oldV = (Version[]) ((JavaObjectData)oldR[verCol
								.getColumnNumber()]).getObject();
						
						Version[] newV =new Version[oldV.length + 1];
						for(int j=0;j<oldV.length;j++){
							newV[j+1]=oldV[j];
						}
						newV[0] = new Version(val, upTime);
						newR[verCol.getColumnNumber()] = new JavaObjectData(
								newV);
					}
				}
			}
			++i;
		}
	} catch (Exception e) {
		throw new TriggerException(e.getMessage());
	}
}
 
开发者ID:andrew-nguyen,项目名称:ucanaccess,代码行数:45,代码来源:TriggerAppendOnly.java


示例10: writeOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected void writeOther(JavaObjectData o) {

        ensureRoom(o.getBytesLength() * 2 + 2);
        write('\'');
        StringConverter.writeHexBytes(getBuffer(), count, o.getBytes());

        count += o.getBytesLength() * 2;

        write('\'');
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:11,代码来源:RowOutputTextLog.java


示例11: getObject

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
/**
 * <!-- start generic documentation -->
 * <p>Gets the value of the designated column in the current row
 * of this <code>ResultSet</code> object as
 * an <code>Object</code> in the Java programming language.
 *
 * <p>This method will return the value of the given column as a
 * Java object.  The type of the Java object will be the default
 * Java object type corresponding to the column's SQL type,
 * following the mapping for built-in types specified in the JDBC
 * specification. If the value is an SQL <code>NULL</code>,
 * the driver returns a Java <code>null</code>.
 *
 * <p>This method may also be used to read database-specific
 * abstract data types.
 *
 * In the JDBC 2.0 API, the behavior of method
 * <code>getObject</code> is extended to materialize
 * data of SQL user-defined types.
 * <p>
 * If <code>Connection.getTypeMap</code> does not throw a
 * <code>SQLFeatureNotSupportedException</code>,
 * then when a column contains a structured or distinct value,
 * the behavior of this method is as
 * if it were a call to: <code>getObject(columnIndex,
 * this.getStatement().getConnection().getTypeMap())</code>.
 *
 * If <code>Connection.getTypeMap</code> does throw a
 * <code>SQLFeatureNotSupportedException</code>,
 * then structured values are not supported, and distinct values
 * are mapped to the default Java class as determined by the
 * underlying SQL type of the DISTINCT type.
 * <!-- end generic documentation -->
 *
 * @param columnIndex the first column is 1, the second is 2, ...
 * @return a <code>java.lang.Object</code> holding the column value
 * @exception SQLException if a database access error occurs or this method is
 *            called on a closed result set
 */
public Object getObject(int columnIndex) throws SQLException {

    checkColumn(columnIndex);

    Type sourceType = resultMetaData.columnTypes[columnIndex - 1];

    switch (sourceType.typeCode) {

        case Types.SQL_DATE :
            return getDate(columnIndex);
        case Types.SQL_TIME :
        case Types.SQL_TIME_WITH_TIME_ZONE :
            return getTime(columnIndex);
        case Types.SQL_TIMESTAMP :
        case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
            return getTimestamp(columnIndex);
        case Types.SQL_BINARY :
        case Types.SQL_VARBINARY :
            return getBytes(columnIndex);
        case Types.OTHER :
        case Types.JAVA_OBJECT : {
            Object o = getColumnInType(columnIndex, sourceType);

            if (o == null) {
                return null;
            }

            try {
                return ((JavaObjectData) o).getObject();
            } catch (HsqlException e) {
                throw Util.sqlException(e);
            }
        }
        default :
            return getColumnInType(columnIndex, sourceType);
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:77,代码来源:JDBCResultSet.java


示例12: writeOther

import org.hsqldb.types.JavaObjectData; //导入依赖的package包/类
protected void writeOther(JavaObjectData o) {

        byte[] ba = o.getBytes();

        writeByteArray(ba);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:7,代码来源:RowOutputText.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RepositoryException类代码示例发布时间:2022-05-22
下一篇:
Java DBMeta类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap