title: H2 refuses connection to localhost
body: <p>i have this very simple java class where i try to run a H2 DB like this:</p>
  
  <pre><code>public static void main(String[] args) {
       Connection conn = null;
                  try {
              Class.forName("org.h2.Driver");
              Server server = Server.createTcpServer("-tcpPort", "50001", "-tcpAllowOthers").start();
  
              conn = DriverManager.getConnection(
                      "jdbc:h2:tcp://localhost/~/H2TestDB/SMPS_DK", "sa", "sa");
  </code></pre>
  
  <p>I tried to copy what i found here and in the H2 doc already but for some reason the connection gets refused. I tried to find the solution here but havent been successfull so far. FYI: I am kind of a rookie so it would be great to get a more detailed answer if possible ;) Thanks in advance!</p>
  
  <p>Here comes the stacktrace:</p>
  
  <pre><code>&gt; org.h2.jdbc.JdbcSQLException: Verbindung ist unterbrochen: "java.net.ConnectException: Connection refused: connect: localhost"
  Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-196]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
      at org.h2.message.DbException.get(DbException.java:168)
      at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:457)
      at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:334)
      at org.h2.jdbc.JdbcConnection.&lt;init&gt;(JdbcConnection.java:116)
      at org.h2.jdbc.JdbcConnection.&lt;init&gt;(JdbcConnection.java:100)
      at org.h2.Driver.connect(Driver.java:69)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at connection.Main.main(Main.java:26)
  Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
      at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at org.h2.util.NetUtils.createSocket(NetUtils.java:103)
      at org.h2.util.NetUtils.createSocket(NetUtils.java:83)
      at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:115)
      at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:453)
      ... 7 more
  </code></pre>