Hello Thomas, Sorry for my late reply. I had too much to do..
I took the latest h2 and then it works. I could open a database created without nioMapped with nioMapped. I tried it with 2 different databases and it now works. Maybe the one I had a problem with was corrupted... Anyways, it seems not to be a problem with the code - unless you changed something between the last version (1.1.111) and the previous one. Thanks, Patrice On Apr 5, 7:03 am, Thomas Mueller <[email protected]> wrote: > Hi, > > > There is a problem though: I could not connect to a previous database > > created with jdbc:h2:.. using jdbc:h2:nioMapped:... Is it normal? Is > > so, do you think that a future version will take care to make the > > database compatible? > > No, it's not normal. Is there an exception? Could you post the stack > trace? If you have time, could you also create a very simple test case > that deletes the database, creates it with one mode and then opens it > with the other? Just edit the code below. It works for me (I also use > Mac OS X): > > import java.sql.Connection; > import java.sql.DriverManager; > import java.sql.ResultSet; > import org.h2.tools.DeleteDbFiles; > > public class Test { > public static void main(String[] args) throws Exception { > DeleteDbFiles.execute("~", "test", true); > Class.forName("org.h2.Driver"); > Connection conn = DriverManager.getConnection( > "jdbc:h2:~/test"); > conn.createStatement().execute( > "create table test(n varchar) as select 'Hello'"); > conn.close(); > conn = DriverManager.getConnection( > "jdbc:h2:nioMapped:~/test"); > ResultSet rs = conn.createStatement().executeQuery( > "select * from test"); > rs.next(); > System.out.println("nioMapped: " + rs.getString(1)); > conn.close(); > conn = DriverManager.getConnection( > "jdbc:h2:nio:~/test"); > rs = conn.createStatement().executeQuery( > "select * from test"); > rs.next(); > System.out.println("nio: " + rs.getString(1)); > conn.close(); > } > > } > > Regards, > Thomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
