> 1. How do you check for the existance of a table ? Do I need to carry
> out a select statement to check if the table exist ?
Why do you need to check it?
See http://www.h2database.com/html/grammar.html for the grammar.
specially CREATE TABLE IF NOT EXISTS
> 2. I would like to select the first row , first column of a table, how
> should I do that ?
Maybe you should read a general SQL tutorial first, for example
http://www.w3schools.com/sql/default.asp
Tables don't have a 'first row'. Maybe you mean 'any row'.
SELECT ID FROM TEST LIMIT 1;
See http://www.h2database.com/html/grammar.html
> 3. I am creating a java application in Client-Server mode with SSL and
> AES encryption. Besides adding the h2.jar into the project (NetBeans
> 6), do I need to install any program before my java application can
> access the H2 database ?
No.
> 4. I have a H2 installed in my computer. I have no trouble running H2
> and getting to the web console although the command prompt(Win XP)
> would say the following...
>
> Port is in use, maybe another Web server already running on http://localhost:8082
> Port is in use, maybe another TCP server already running on tcp://localhost:9092
>
> Press any key to continue . . .
>
> Despite the message, the web console started fine and I can connect
> and create user and tables in the web console. Now when I was thinking
> to start H2 to do some testing , the same message above appear but the
> web console didn't appear instead it's a blank untitled page with a
> pop up (Firefox 2) saying:
>
> " You have chosen to open
>
> which is a: application/octet-stream
> from: http://localhsot:8082
>
> What should Firefox do with this file ?
>
> Open with ...
>
> Save to Disc "
>
> I am not sure why this time the web console failed ?
Maybe some other application is running on this port. What about
downloading this file and seeing what is the content (with Notepad).
> Do I need to reinstall
> again ?
Probably not.
Regards,
Thomas
> I thought I should reinstall the service and after reinstalling and
> running H2, it worked... the web console was up again...although I lst
> my users and data but luckily...these were test data and not
> important.
What database URL did you use?
jdbc:h2:~/test
should create the database in the home directory of the current user,
so the database should not get lost.
Regards,
Thomas
> I never use the home directory, I always use -baseDir [] with a URL
> that includes an absolute path: jdbc:h2:tcp://localhost/test ... is
> there a problem with this configuration? I have never had a
> problem ...
No, but it looks quite a lot of people have trouble with the database
path. Maybe I should just disallow relative database paths...
Regards,
Thomas
> The same problem with H2 happened again when I tried to run
> H2.bat . The firefox prompted the same thing and the command prompt
> claim that the ports are not open.
Could you check if the ports are in use before you start H2.bat? For
example (when using port 1039):
c:\data>telnet localhost 1039
Connecting To localhost...Could not open connection to the host, on
port 1039: Connect failed
This means the port is not in use. If it is in use, you will get a
blank screen or maybe some other strange data.
Regards,
Thomas