hsqldb:现有数据库的加密? [英] hsqldb: Encryption of an existing database?

查看:158
本文介绍了hsqldb:现有数据库的加密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道一种加密现有hsql数据库而不丢失其内容的方法吗?

Do you know a method to encrypt an existing hsql database without loosing it contents?

我想稍后将其与jdbc网址一起使用

I want to use it afterwards with the jdbc url

jdbc:hsqldb:file:<database path>;crypt_key=<key>;crypt_type=blowfish

推荐答案

做到这一点的唯一方法是修改代码并构建一个特殊的jar,该jar可以读取明文形式的.script,但是所有的编写都使用加密.

The only way to do this is by modifying the code and building a special jar that reads the .script in clear text, but does all the writing with encryption.

使用普通jar,在现有数据库上执行SHUTDOWN SCRIPT,将其转换为.script文件.

With the normal jar, execute SHUTDOWN SCRIPT on the existing database to turn it into a .script file.

使用Crypto crypto = null;而不是现有行修改org.hsqldb.persist.Log#processScript().使用Ant或Gradle编译jar.

Modify org.hsqldb.persist.Log#processScript() with Crypto crypto = null; instead of the existing line. Compile the jar using Ant or Gradle.

使用特殊罐子的加密URL打开数据库,然后执行SHUTDOWN.这将加密数据库

Open the database with the encryption URL the special jar and execute SHUTDOWN. This will encrypt the database

使用普通的jar访问加密的数据库.

Use the normal jar to access the encrypted database.

由于这是一个有用的功能,它可能会添加到HSQLDB的将来版本中.

As this is a useful feature, it may be added to future versions of HSQLDB.

这篇关于hsqldb:现有数据库的加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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