Open encrypted sqlite database file with java

I want to know with which java lib my java code could  can connect to a encrypted database.
fxp007Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mick BarryJava DeveloperCommented:
you would use jdbc to access database
0
CEHJCommented:
0
fxp007Author Commented:
I'm afraid that it doesn't support open encrypted database.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

CEHJCommented:
How is the db being encrypted?
0
fxp007Author Commented:
I don't know how, but I can open it with SharpPlus Sqlite Developer 3.6.5 with password
0
fxp007Author Commented:
And I can read some part of it (except date type data) with a C# sqlite lib.
0
CEHJCommented:
This appears to support encryption

http://www.ch-werner.de/javasqlite/SQLite/Database.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fxp007Author Commented:
Thanks, I've tried this, but it doesn't work.
I use the key(string) function but it failed still with exception:
error: SQLite.Exception: file is encrypted or is not a database

I found the key function in java doc said:
Not available in public releases of SQLite.

I don't quite understand with what does the "public releases" refers to.
SQLite.Database db = new SQLite.Database();
try {
 db.key("password");
 db.open("d:\\database.dat", SQLite.Constants.SQLITE_OPEN_READONLY);
	    System.out.print(db.get_table("select * from MessageBody"));
 } catch (java.lang.Exception e) {
	    System.err.println("error: " + e);

Open in new window

0
Mick BarryJava DeveloperCommented:
its not a standard feature so its probably not going to be built in to most drivers
(to access from java) you may need to either remove the encryption or using a different database
0
CEHJCommented:

>>I don't quite understand with what does the "public releases" refers to.

Could mean there are paid versions that support it.

Derby supports encryption afaik
0
fxp007Author Commented:
Or it means I need to change a jdbc driver for sqlite?
0
Mick BarryJava DeveloperCommented:
> Or it means I need to change a jdbc driver for sqlite?

you need a driver that supports encryption and I'm not aware of one. Probably because its not a standard feature. If you you need encryption then I mention above you could use a db that supports it out of box (eg. derby), or if you don't need encryption then just get rid of it.
0
fxp007Author Commented:
I know the reason but not solve the probem
0
CEHJCommented:
Is that sorted out?
0
fxp007Author Commented:
No, but I changed to using C# with sqlite.NET instead.Thank you anyway
0
CEHJCommented:
:-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.