“我的应用程序使用了springboot hadoop和maprdb。我以前从未使用过springhadoop和maprdb。请引导。我想删除maprdb代码并连接到mangodb。
my code is like this '
public static List<> getData(String a){
List<> DataList = new ArrayList<>();
Connection connection = DriverManager.getConnection("ojai:mapr:");
try
{
DoctumentStore store = connection.getstore(table);
Query query = connection.newQuery().where(connection.newCondition()
.matched("_id", code+"*"),build()).build();
DoctumentStream stream = store.find(query);
for(Document Doc : stream){
ObjectMapper objectmapper = ObjectMapper();
DataList.add(objectMapper.readValue(Doc.asJsonString(),abc.class));
}
store.close();
}
catch(Exception e){
e.printStackTrace();
connection.close();
}
connection.close();
return DataList;
}
}
暂无答案!
目前还没有任何答案,快来回答吧!