Thanks, I extracted successfully data from .mv.db.

I used your code and modified it to test my h2 db version 1.3.176 so, 
again, I got two times bigger db.
My code is:
                          Class.forName("org.h2.Driver");
              String user = "sa";
              String password = "mypass";
 String url = String.format("jdbc:h2:%s/mydb" + ";CIPHER=AES", myPath);
 Connection c = DriverManager.getConnection(url, user, password) ;
 Statement s = c.createStatement();
 s.execute("CREATE TABLE TEST (ID IDENTITY PRIMARY KEY, B BLOB)");
 PreparedStatement ps = c.prepareStatement("INSERT INTO TEST(B) VALUES 
(?)");
 byte[] b = new byte [1500000];
 Random r = new Random();
 r.setSeed(0L);
 r.nextBytes(b);
 ps.setBytes(1, b);
 ps.executeUpdate();
 c.close();

So, I randomly generated file of 1.5MB and got mydb.h2.db file of 3.46MB!?? 
Why? 

On Thursday, November 15, 2018 at 2:36:33 PM UTC+1, Evgenij Ryazanov wrote:
>
> Database is not an archive.
>
> If you stored a BLOB or BINARY value in a database, you have to connect to 
> this database again and execute an appropriate SQL query. After it you can 
> read the data from the returned ResultSet and store it where you want.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to