OK. Thanks for all the help.
It seems to be working somewhat, in that I am not getting the file
locked warning anymore.
I have the following:
A server program that has:
Server server = Server.createTcpServer().start();
Two applications that have:
Connection conn = DriverManager.getConnection("jdbc:h2:tcp://localhost/
~/test", "sa", "");
whenever they are accessing the database.
However, when i launch one of my programs, it says:
Could not start Server for the DataFeed
Databaseorg.h2.jdbc.JdbcSQLException: Exception opening port
"9092" (port may be in use), cause: "java.net.BindException: Address
already in use: JVM_Bind" [90061-126]
but then seems to work as it updates the database anyway... Not why i
am getting this warning as i connect to the server exactly as per the
documentation. (Also tried with the path name as you showed me, but i
dont know how to find the location of a database on my hard drive)
Also, after a minute or so, both my programs breakdown and give the
the following warning
org.h2.jdbc.JdbcSQLException: Connection is broken: "session
closed" [90067-126]
Why is this happening?
Thanks a lot!
On Jan 22, 4:44 pm, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> Again, please read the documentation. Then try simple examples first
> (using the documentation), and then, once this works, do more complex
> stuff. Be very careful with the syntax, specially in database URLs.
>
> > Seems to me that my second app tries to start the server, but
> > obviously can't since it's already there. What am i doing wrong?
>
> Obviously, your application tried to start the server twice.
>
> > jdbc:h2://localhost/~/test
>
> I guess you wanted to use
>
> jdbc:h2:tcp://localhost/~/test. Not
> jdbc:h2:tcp//localhost/~/test and not
> jdbc:h2:tcp//localhost///C/test or anything like that.
>
> > Server server =
> > Server.createTcpServer("jdbc:h2://localhost/~/test","sa","").start();
>
> Funny idea :-)
>
> > Connection conn = DriverManager.getConnection("jdbc:h2:tcp//localhost//
>
> C:/Documents and Settings/Ruben/test", "sa", "");
>
> Better, but not quite. The syntax is wrong. Try:
>
> Connection conn =
> DriverManager.getConnection("jdbc:h2:tcp://localhost/C:/Documents and
> Settings/Ruben/test", "sa", "");
>
> 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.