This sample code runs into an OutOfMemoryError on my Mac with h2
database version 1.2.121
Is there another way to start a TCP-Server locally and connect it from
localhost and also from remote systems?

Class.forName("org.h2.Driver");
dbServer = Server.createTcpServer(new String[] {"-tcpAllowOthers", "-
baseDir", dbPath}).start();
connection = DriverManager.getConnection("jdbc:h2:tcp://localhost/
testDB","sa", "");

Stracktrace:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at org.h2.command.CommandRemote.prepare(CommandRemote.java:82)
        at org.h2.command.CommandRemote.<init>(CommandRemote.java:48)
        at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:418)
        at org.h2.engine.SessionRemote.upgradeClientVersionIfPossible
(SessionRemote.java:359)
        at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:352)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer
(SessionRemote.java:229)
        at org.h2.engine.SessionRemote.createSession(SessionRemote.java:223)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:110)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:94)
        at org.h2.Driver.connect(Driver.java:58)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at rezeptSuite.service.db.SerDBHandler.initDBConnection
(SerDBHandler.java:72)
        at rezeptSuite.control.ControlRezeptVerwaltung.start
(ControlRezeptVerwaltung.java:79)
        at rezeptSuite.control.ControlRezeptVerwaltung.main
(ControlRezeptVerwaltung.java:173)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to