对内存数据库中的Java的建议 [英] Recommendation for a Java in memory database

查看:49
本文介绍了对内存数据库中的Java的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在寻找建议.我有一个命令行实用程序,现在需要处理大量来自Web服务的CSV格式的数据.

Looking for a recommendation. I have a command line utility that now needs to process a large amount of data coming from a web service in a form of a CSV.

我需要对数据进行多次测试以查找异常和模式.我希望该实用程序可以供某人下载,而不必安装或配置.

I need to run multiple tests on the data to look for anomalies and patterns. I'd like the utility to be something that someone can download and not have to install or configure.

是否有关于NoSQL或SQL数据库的建议,我可以在内存中快速启动,将CSV加载到表中,然后对这些数据运行查询?

Is there a recommendation for a NoSQL or SQL database that I can just spin up in memory, load the CSV into a table and then run my queries against that data?

Redis无需安装即可使用吗?还有吗?

Can Redis be used without installation? Something else?

推荐答案

H2数据库怎么样?它是纯Java内存,可以嵌入到您的应用程序中,请参见

How about H2 Database? It's pure Java, in-memory and can be embedded into your application, see Connecting to an Embedded (Local) Database

示例:

import org.h2.jdbcx.JdbcDataSource;

JdbcDataSource ds = new JdbcDataSource();
ds.setURL("jdbc:h2:˜/test.db");
ds.setUser("sa");
ds.setPassword("sa");
Connection conn = ds.getConnection();

(改编自 http://www.h2database.com/javadoc/org/h2/jdbcx/JdbcDataSource.html )

如果要使用内存数据库,请将URL更改为 jdbc:h2:mem:test.db 或类似名称.在文档中查找内存数据库".

If you want an in-memory database, change URL to something like jdbc:h2:mem:test.db or similar. Look for "in-memory Databases" in documentation.

这篇关于对内存数据库中的Java的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆