1) All tests run on localhost
2) No firewall installed on windows xp dev machine
3) Installed tcp service as instructed
4) Logged into web console from browser using: jdbc:h2:tcp://localhost/
c://db/mytest
5) Saw that database was created and logged in just fine, created a
table
6) Created Test.java with this in its main method:
try
{
Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:tcp://
localhost/c://db/mytest", "xx", "xx");
System.out.println("**********Worked");
conn.close();
}
catch(Throwable t)
{
t.printStackTrace();
}
7) It failed with this exception:
org.h2.jdbc.JdbcSQLException: Connection is broken [90067-50]
at org.h2.message.Message.getSQLException(Message.java:65)
at org.h2.message.Message.getSQLException(Message.java:47)
at org.h2.message.Message.getSQLException(Message.java:86)
at org.h2.engine.SessionRemote.checkClosed(SessionRemote.java:245)
at org.h2.engine.SessionRemote.connect(SessionRemote.java:217)
at org.h2.engine.SessionRemote.<init>(SessionRemote.java:160)
at org.h2.engine.SessionRemote.createSession(SessionRemote.java:155)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:921)
at org.h2.Driver.connect(Driver.java:52)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
....
8) Change java application to login WITHOUT tcp and it works just fine
hitting the same database created before:
Connection conn = DriverManager.getConnection("jdbc:h2:/db/
mytest", "xx", "xx");
WHAT AM I DOING WRONG!!!! Thanks for your time.
The command would look something like:
java -cp h2.jar org.h2.tools.Server -tcp
Yes, the server needs to be started. See also
http://www.h2database.com/html/tutorial.html#using_server
Thomas
My fault. I assumed the latest h2-1.0xxx.jar in the ibiblio maven2
repository was the most current and thus would match the server I
downloaded. I was wrong. Version 1.0.20070802 wasn't there and so I
was using the wrong client jar for the server. Sorry to waste your
time. A thousand apologies.
On Aug 8, 10:14 pm, "Thomas Mueller" <thomas.tom.muel...@gmail.com>
wrote:
> Hi,
>
> Yes, the server needs to be started. See alsohttp://www.h2database.com/html/tutorial.html#using_server
Currently the process of updating the maven repository is manual. It
seems that more and more people are using Maven, and that from now on
every release should be added to the ibiblio repository. I will try to
automate this process.
> Is there anyway to have the console start a TCP server also?
This is done automatically when running
java org.h2.tools.Console
see also http://www.h2database.com/html/tutorial.html#using_server
Thomas
> Is there anyway to have the console start a TCP server also?
This is done automatically when running
java org.h2.tools.Console
see also http://www.h2database.com/html/tutorial.html#using_server
If you type
java org.h2.tools.Server -?
you will see that it's 9092. I will add this to the docs.
Thomas