To specify the port use string arguments like that
Server.createWebServer("-webPort", "100500").start();
See also http://h2database.com/javadoc/org/h2/tools/Server.html#main_String...If you running inside of eclipse it would be better not to use external config files. On 24 ноя, 19:06, marcolopes <[email protected]> wrote: > Great! Works like a charm. > > I have a few doubts: > > 1) As far as i can see, the embedded server does not take > the .h2.server.properties file into account. Is this configuration > file only used with the local or remote server? If so, how can we > specify the PORT of the embedded server? > > 2) The console USES the .h2.server.properties. Can i specify a path > for the console to read that file? I can't find any methods in > org.h2.tools.Server (the purpose is, for example, to make a portable > app that will have the config file on the path we need to) > > thanks. > > On Nov 24, 3:41 pm, Sergi Vladykin <[email protected]> wrote: > > > You should not use console but just start web server directly from > > your app > > org.h2.tools.Server.createWebServer().start(); > > for example on plugin initialization and then manually open views or > > editors with browser and point it to correct url. > > > On Nov 24, 6:11 pm, marcolopes <[email protected]> wrote: > > > > I have tested H2 as a server, and now i have it "embedded" in a > > >Eclipse RCPJava App. > > > > Everything works just fine connecting to theDatabase engine. Embedded > > > (local) connection jdbc:h2:[file:][] > > > > Now, can i connect to the H2 HTTP Console using the Embedded server? > > > > Virtually, allEclipse RCPviews have browser capability, so the > > > preferred way would be to execute the console inside em RCP view. > > > > Basically i need to set the browser url inside the view: > > > browser.setUrl(url); > > > > But the H2 console must be called specifically with: > > > org.h2.tools.Server.openBrowser(url); This opens the the console into > > > an external browser and does not connect to the embedded browser. > > > > thanks. -- 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.
