H2 database control: Difference between revisions
imported>Kymara Created page with '== Fiddling with the H2 Database == Make sure the game server is '''not running''' (using '''CTRL+c''' at the server command window). Otherwise you'll get this error later: [[F…' |
imported>Ufizavipupu No edit summary |
||
| Line 1: | Line 1: | ||
---- |
|||
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> |
|||
---- |
|||
=[http://yxiwisewava.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]= |
|||
---- |
|||
=[http://yxiwisewava.co.cc CLICK HERE]= |
|||
---- |
|||
</div> |
|||
== Fiddling with the H2 Database == |
== Fiddling with the H2 Database == |
||
Make sure the game server is '''not running''' (using '''CTRL+c''' at the server command window). Otherwise you'll get this error later: |
Make sure the game server is '''not running''' (using '''CTRL+c''' at the server command window). Otherwise you'll get this error later: |
||
Revision as of 01:17, 24 November 2010
Fiddling with the H2 Database
Make sure the game server is not running (using CTRL+c at the server command window). Otherwise you'll get this error later:
Open a command window as explained above. Use cd (change directory) to get to the server's folder (where a file named h2.jar should exist) and copy and paste this:
java -cp h2*.jar org.h2.tools.Server
You'll notice that your default browser automatically opens, showing a page that offers access to databases:
Alternatively, you can see it with any other web browser by entering the following URL:
http://localhost:8082/
At the URL JDBC: text field, copy and paste this:
jdbc:h2:~/stendhal/database/h2db
Make sure the Username and Password fields are empty:
and click on the [Connect] button:
Now you should have been given access to the game database.
For starters, you can see the accounts in the database by clicking on the ACCOUNT table name on the left graphical tree:
You'll notice that in the SQL instruction text box at the right:
a new SQL statement has automatically appeared:
Now, just click on the [Execute] button (or alternatively type CTRL+Enter) and you can see the results of the SQL statement just below the 'SQL instruction' text box:
Feel free to experiment from here on. :)
To stop the database engine use the same method as with the game server: type CTRL+c at the command window.





