Package org.tmatesoft.sqljet.core

Examples of org.tmatesoft.sqljet.core.SqlJetEncoding


     */
    public void handleBom() {

        final SqlJetVdbeMem pMem = this;

        SqlJetEncoding bom = null;

        if (pMem.n < 0 || pMem.n > 1) {
            short b1 = (short) getUnsignedByte(pMem.z, 0);
            short b2 = (short) getUnsignedByte(pMem.z, 1);
            if (b1 == 0xFE && b2 == 0xFF) {
View Full Code Here


     * @return
     * @throws SqlJetException
     */
    private void doInsert(SqlJetConflictAction onConflict, final long rowId, final Object[] row) throws SqlJetException {
        final ISqlJetMemoryPointer pData;
        final SqlJetEncoding encoding = btree.getDb().getOptions().getEncoding();
        if (!tableDef.isRowIdPrimaryKey()) {
            pData = SqlJetBtreeRecord.getRecord(encoding, row).getRawRecord();
        } else {
            final int primaryKeyColumnNumber = tableDef.getColumnNumber(tableDef.getRowIdPrimaryKeyColumnName());
            if (primaryKeyColumnNumber == -1 || primaryKeyColumnNumber >= row.length)
View Full Code Here

        if (newRowId == currentRowId && Arrays.equals(rowCompleted, currentRow))
            return;

        final ISqlJetMemoryPointer pData;
        final SqlJetEncoding encoding = btree.getDb().getOptions().getEncoding();
        if (!tableDef.isRowIdPrimaryKey()) {
            pData = SqlJetBtreeRecord.getRecord(encoding, rowCompleted).getRawRecord();
        } else {
            final int primaryKeyColumnNumber = tableDef.getColumnNumber(tableDef.getRowIdPrimaryKeyColumnName());
            if (primaryKeyColumnNumber == -1 || primaryKeyColumnNumber >= rowCompleted.length)
View Full Code Here

                } else {
                    throw new SqlJetException(SqlJetErrorCode.ERROR, "Invalid cache_size value: " + value);
                }
            } else if ("encoding".equals(name)) {
                if (value instanceof String) {
                    SqlJetEncoding enc = SqlJetEncoding.decode((String) value);
                    if (enc != null) {
                        getOptions().setEncoding(enc);
                    } else {
                        throw new SqlJetException(SqlJetErrorCode.ERROR, "Unknown encoding: " + value);
                    }
View Full Code Here

     * @param values
     * @return
     * @throws SqlJetException
     */
    private long lookupSafe(boolean next, boolean near, boolean last, Object... values) throws SqlJetException {
        final SqlJetEncoding encoding = btree.getDb().getOptions().getEncoding();
        ISqlJetBtreeRecord key = SqlJetBtreeRecord.getRecord(encoding, values);
        final ISqlJetMemoryPointer k = key.getRawRecord();
        if (next) {
            if (!last) {
                next();
View Full Code Here

        flags.add(SqlJetUnpackedRecordFlags.PREFIX_MATCH);
        return unpacked.recordCompare(record.remaining(), record);
    }

    public int compareKeys(Object[] firstKey, Object[] lastKey) throws SqlJetException {
        final SqlJetEncoding encoding = btree.getDb().getOptions().getEncoding();
        final ISqlJetMemoryPointer firstRec = SqlJetBtreeRecord.getRecord(encoding, firstKey).getRawRecord();
        final ISqlJetMemoryPointer lastRec = SqlJetBtreeRecord.getRecord(encoding, lastKey).getRawRecord();
        final SqlJetUnpackedRecord unpacked = getKeyInfo().recordUnpack(firstRec.remaining(), firstRec);
        unpacked.getFlags().add(SqlJetUnpackedRecordFlags.PREFIX_MATCH);
        return unpacked.recordCompare(lastRec.remaining(), lastRec);
View Full Code Here

TOP

Related Classes of org.tmatesoft.sqljet.core.SqlJetEncoding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.