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

Java StringConverter类代码示例

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

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



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

示例1: writeByteArray

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
protected void writeByteArray(byte[] b) {

        if (textFileSettings.isUTF16) {
            byte[] buffer = new byte[b.length * 2];

            StringConverter.writeHexBytes(buffer, 0, b);

            String s = new String(buffer);

            writeBytes(s);
        } else {
            ensureRoom(b.length * 2);
            StringConverter.writeHexBytes(this.getBuffer(), count, b);

            count += b.length * 2;
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:18,代码来源:RowOutputText.java


示例2: readString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public String readString() {

        try {
            int length = readInt();

            if (length < 0) {
                throw Error.error(ErrorCode.GENERAL_IO_ERROR,
                                  "RowInputBinary - negative length");
            }

            String s = StringConverter.readUTF(buffer, pos, length);

            s   = ValuePool.getString(s);
            pos += length;

            return s;
        } catch (IOException e) {
            throw Error.error(e, ErrorCode.GENERAL_IO_ERROR, "RowInputBinary");
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:21,代码来源:RowInputBinary.java


示例3: setAscStream

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
void setAscStream(int parameterIndex, java.io.InputStream x,
                  long length) throws SQLException {

    if (length > Integer.MAX_VALUE) {
        throw JDBCUtil.sqlException(ErrorCode.X_22001);
    }

    if (x == null) {
        throw JDBCUtil.nullArgument("x");
    }

    try {
        String s = StringConverter.inputStreamToString(x, "US-ASCII");

        if (length >= 0 && s.length() > length) {
            s = s.substring(0, (int) length);
        }
        setParameter(parameterIndex, s);
    } catch (IOException e) {
        throw JDBCUtil.sqlException(ErrorCode.JDBC_INPUTSTREAM_ERROR, null, e);
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:23,代码来源:JDBCPreparedStatement.java


示例4: handshakeCompleted

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public void handshakeCompleted(HandshakeCompletedEvent evt) {

        SSLSession session;
        String     sessionId;
        SSLSocket  socket;

        if (Error.TRACESYSTEMOUT) {
            socket  = evt.getSocket();
            session = evt.getSession();

            Error.printSystemOut("SSL handshake completed:");
            Error.printSystemOut(
                "------------------------------------------------");
            Error.printSystemOut("socket:      : " + socket);
            Error.printSystemOut("cipher suite : " + session.getCipherSuite());

            sessionId = StringConverter.byteArrayToHexString(session.getId());

            Error.printSystemOut("session id   : " + sessionId);
            Error.printSystemOut(
                "------------------------------------------------");
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:24,代码来源:HsqlSocketFactorySecure.java


示例5: rename

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public void rename(String name, boolean isquoted) {

            this.name          = name;
            this.statementName = name;
            this.isNameQuoted  = isquoted;

            if (isNameQuoted) {
                statementName = StringConverter.toQuotedString(name, '"',
                        true);
            }

            if (name.startsWith("SYS_")) {
                int length = sysPrefixLength(name);

                if (length > 0) {
                    try {
                        int temp = Integer.parseInt(name.substring(length));

                        if (temp > manager.sysNumber) {
                            manager.sysNumber = temp;
                        }
                    } catch (NumberFormatException e) {}
                }
            }
        }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:HsqlNameManager.java


示例6: convertToSQLString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public String convertToSQLString(Object a) {

        if (a == null) {
            return "NULL";
        }

        StringBuffer sb = new StringBuffer(32);

        sb.append(Tokens.T_INTERVAL);
        sb.append(StringConverter.toQuotedString(convertToString(a), '\'',
                false));
        sb.append(Tokens.SQL_INTERVAL_FIELD_NAMES[startPartIndex]);
        sb.append(' ');
        sb.append(Tokens.T_TO);
        sb.append(' ');
        sb.append(Tokens.SQL_INTERVAL_FIELD_NAMES[endPartIndex]);

        return sb.toString();
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:IntervalType.java


示例7: checkConvertString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
protected String checkConvertString(String s, String sep) {

        if (textFileSettings.isAllQuoted || s.length() == 0
                || s.indexOf(textFileSettings.quoteChar) != -1
                || (sep.length() > 0 && s.indexOf(sep) != -1)
                || hasUnprintable(s)) {
            s = StringConverter.toQuotedString(s, textFileSettings.quoteChar,
                                               true);
        }

        return s;
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:13,代码来源:RowOutputTextQuoted.java


示例8: getDDL

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
/**
 *  Retrieves the SQL character sequence required to (re)create the
 *  trigger, as a StringBuffer
 *
 * @return the SQL character sequence required to (re)create the
 *  trigger
 */
public StringBuffer getDDL() {

    StringBuffer a = new StringBuffer(256);

    a.append(Token.T_CREATE).append(' ');
    a.append(Token.T_TRIGGER).append(' ');
    a.append(name.statementName).append(' ');
    a.append(when).append(' ');
    a.append(operation).append(' ');
    a.append(Token.T_ON).append(' ');
    a.append(table.getName().statementName).append(' ');

    if (forEachRow) {
        a.append(Token.T_FOR).append(' ');
        a.append(Token.T_EACH).append(' ');
        a.append(Token.T_ROW).append(' ');
    }

    if (nowait) {
        a.append(Token.T_NOWAIT).append(' ');
    }

    if (maxRowsQueued != getDefaultQueueSize()) {
        a.append(Token.T_QUEUE).append(' ');
        a.append(maxRowsQueued).append(' ');
    }

    a.append(Token.T_CALL).append(' ');
    a.append(StringConverter.toQuotedString(triggerClassName, '"',
            false));

    return a;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:41,代码来源:TriggerDef.java


示例9: getMessage

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
/**
 * Subclass-specific override.
 *
 * @return representation of inMethod, file and magic,
 *      as a String object
 */
public String getMessage() {    // override

    String message = super.getMessage() + " magic: ";

    message = message + ((magic == null) ? "null"
                                         : "'"
                                           + StringConverter.byteToHex(magic)
                                           + "'");

    return message;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:LockFile.java


示例10: writeString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public void writeString(String s) {

        int temp = count;

        writeInt(0);
        StringConverter.writeUTF(s, this);
        writeIntData(count - temp - 4, temp);
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:RowOutputBinary.java


示例11: createSQLString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
/**
 *  Turns a java string into a quoted SQL string
 *
 * @param  s java string
 * @return quoted SQL string
 */
public static String createSQLString(String s) {

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

    return StringConverter.toQuotedString(s, '\'', true);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:Column.java


示例12: getHeader

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
private String getHeader() {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        TextCache cache  = (TextCache) store.getCache();
        String    header = cache == null ? null
                                         : cache.getHeader();

        return header == null ? null
                              : StringConverter.toQuotedString(header, '\'',
                              true);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:13,代码来源:TextTable.java


示例13: getConnectUserSQL

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
/**
 * Retrieves the redo log character sequence for connecting
 * this user
 *
 * @return the redo log character sequence for connecting
 *      this user
 */
public String getConnectUserSQL() {

    StringBuffer sb = new StringBuffer();

    sb.append(Tokens.T_SET).append(' ');
    sb.append(Tokens.T_SESSION).append(' ');
    sb.append(Tokens.T_AUTHORIZATION).append(' ');
    sb.append(StringConverter.toQuotedString(getName().getNameString(),
            '\'', true));

    return sb.toString();
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:20,代码来源:User.java


示例14: HsqlName

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
/** for auto names and system-defined names */
private HsqlName(HsqlNameManager man, String name, int type,
                 boolean isQuoted) {

    this(man, type);

    this.name          = name;
    this.statementName = name;
    this.isNameQuoted  = isQuoted;

    if (isNameQuoted) {
        statementName = StringConverter.toQuotedString(name, '"',
                true);
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:16,代码来源:HsqlNameManager.java


示例15: hexToByteArray

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
/**
 * Converts the specified hexadecimal digit <CODE>String</CODE>
 * to an equivalent array of bytes.
 *
 * @param hexString a <CODE>String</CODE> of hexadecimal digits
 * @throws HsqlException if the specified string contains non-hexadecimal digits.
 * @return a byte array equivalent to the specified string of hexadecimal digits
 */
public static byte[] hexToByteArray(String hexString)
throws HsqlException {

    try {
        return StringConverter.hexToByte(hexString);
    } catch (IOException e) {
        throw Trace.error(Trace.INVALID_CHARACTER_ENCODING);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:Column.java


示例16: convertToSQLString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public String convertToSQLString(Object a) {

        if (a == null) {
            return Tokens.T_NULL;
        }

        return StringConverter.byteArrayToSQLBitString(
            ((BinaryData) a).getBytes(),
            (int) ((BinaryData) a).bitLength(null));
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:11,代码来源:BitType.java


示例17: convertToString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public String convertToString(Object a) {

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

        return StringConverter.byteArrayToHexString(((BlobData) a).getBytes());
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:9,代码来源:BinaryType.java


示例18: convertToSQLString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public String convertToSQLString(Object a) {

        if (a == null) {
            return Tokens.T_NULL;
        }

        return StringConverter.byteArrayToSQLHexString(
            ((BinaryData) a).getBytes());
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:10,代码来源:BinaryType.java


示例19: convertToSQLString

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
public String convertToSQLString(Object a) {

        if (a == null) {
            return Tokens.T_NULL;
        }

        StringBuffer sb = new StringBuffer(32);

        switch (typeCode) {

            case Types.SQL_DATE :
                sb.append(Tokens.T_DATE);
                break;

            case Types.SQL_TIME_WITH_TIME_ZONE :
            case Types.SQL_TIME :
                sb.append(Tokens.T_TIME);
                break;

            case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
            case Types.SQL_TIMESTAMP :
                sb.append(Tokens.T_TIMESTAMP);
                break;
        }

        sb.append(StringConverter.toQuotedString(convertToString(a), '\'',
                false));

        return sb.toString();
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:31,代码来源:DateTimeType.java


示例20: rename

import org.hsqldb.lib.StringConverter; //导入依赖的package包/类
void rename(String name, boolean isquoted) throws HsqlException {

            this.name          = name;
            this.statementName = name;
            this.isNameQuoted  = isquoted;

            if (name == null || name.length() == 0) {
                throw Trace.error(Trace.INVALID_IDENTIFIER);
            }

            if (isNameQuoted) {
                statementName = StringConverter.toQuotedString(name, '"',
                        true);
            }

            if (name.startsWith("SYS_")) {
                int index = name.lastIndexOf('_') + 1;

                try {
                    int temp = Integer.parseInt(name.substring(index));

                    if (temp > manager.sysNumber) {
                        manager.sysNumber = temp;
                    }
                } catch (NumberFormatException e) {}
            }
        }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:HsqlNameManager.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java JRClassLoader类代码示例发布时间:2022-05-22
下一篇:
Java SELCoderDescriptor类代码示例发布时间: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