How to use H2 in Server Mode?

So this is what I have done..

First I added h2 db dependency to pom.xml..
<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <version>1.4.192</version>
</dependency>

and then the .jar file, h2-1.4.192.jar was in my maven repo, what a surprise.

Anyway, then I copied this jar to C:\Dev\h2.

I will just start the database as seen below from C:\Dev\h2
java -jar h2-1.3.160.jar -webAllowOthers -tcpAllowOthers

So when you do this, you can just go to http://192.168.2.116:8082/ and see your database actually. Anyway, I just typed jdbc:h2:~/h2dbs/studentform and connected to the database, since this db did not exists before, it is just created..

And then I just downloaded dbeaver. from here and created the tables I needed..

And in my application, this is what I did, I created a context.xml file under META-INF directory:
<?xml version='1.0' encoding='utf-8'?>
<Context>
    <Resource name="jdbc/studentform" auth="Container" type="javax.sql.DataSource"
              maxActive="5" maxIdle="5" maxWait="10000"
              username="sa" password="" driverClassName="org.h2.Driver"
              url="jdbc:h2:tcp://localhost:9092/~/h2dbs/studentform"/>
</Context>

 And in web.xml I have:
<resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/studentform</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

Finally just a sample code how I connect to db:
final Context ctx = new InitialContext();
final DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/studentform");
final Connection conn = ds.getConnection();
final Statement statement = conn.createStatement();
final String sql = "INSERT INTO STUDENT(FULLNAME) VALUES('" + fullname + "');";
statement.execute(sql);
conn.close();

So this is it!! h2 here acts just like mysql server actually.. I think it is pretty cool.