我正在寻找存储一些数据的方法。我希望我的程序的用户能够选择一种存储数据的方式。他们可以选择数据库(PostgreSQL、MySQL),我想给新手用户选择更简单的方式的机会,这样他们就不必安装数据库系统。当他们第一次启动我的程序时,他们正在传递用户数据(登录名/密码),并且我的程序生成的一些数据存储在用户的硬盘上。它是任何库(用于Java)或类似db的东西,但是当我这样做时会自动配置?我的意思是,我想在 db 中创建一些表并轻松访问它们。但它们应该是安全的(只能通过第一次传递的登录名/密码访问)。我希望你能理解我。很难解释我想要什么:)
问问题
421 次
2 回答
4
您可以使用嵌入式数据库,例如Apache Derby。另请参阅使用加密一文。
于 2011-03-10T17:50:54.903 回答
3
如果我理解正确,您需要可以存储加密数据的嵌入式 SQL DB 引擎吗?看看h2 数据库 它是轻量级的并且有这个
Security Features
Includes a solution for the SQL injection problem
User password authentication uses SHA-256 and salt
For server mode connections, user passwords are never transmitted in plain text over the network (even when using insecure connections; this only applies to the TCP server and not to the H2 Console however; it also doesn't apply if you set the password in the database URL)
All database files (including script files that can be used to backup data) can be encrypted using AES-128 and XTEA encryption algorithms
The remote JDBC driver supports TCP/IP connections over SSL/TLS
The built-in web server supports connections over SSL/TLS
Passwords can be sent to the database using char arrays instead of Strings
于 2011-03-10T17:54:07.400 回答