Java 操作BDB 如何实现复合查询? 急

例如: select * from table where A=? and B=? and c<? order by D

3个回答

嘛意思?没看明白

[code="java"]public class Test {
public static List get(String key) {
ArrayList nuclearStorageValue = new ArrayList();

    DatabaseEntry queryKey = new DatabaseEntry();
    DatabaseEntry value = new DatabaseEntry();
    queryKey.setData(key.getBytes());
    Cursor cursor = null;
    try {
        cursor = db.openCursor(null, null);
        for (
                OperationStatus status = cursor.getSearchKey(queryKey, value,LockMode.READ_UNCOMMITTED);
                status == OperationStatus.SUCCESS; 
                status = cursor.getNextDup(queryKey, value, LockMode.RMW)
                ) {

            nuclearStorageValue.add(value.getData().toString());
        }
    } catch (DatabaseException e) {
        System.out.println(e);
    } finally {
        attemptClose(cursor);
    }
    return nuclearStorageValue;
}

}
[/code]

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐