title: Codename one online database Connection
body: <p>I am trying to establish an online connection to a database using <code>Eclipse</code> and the <code>codename one</code> cross platform environment.</p>
  
  <p>As obvious, having your local database within the default folder provides you an access to the database and the connection code is as follows:</p>
  
  <pre><code>db = Display.getInstance().openOrCreate("MyDB.db");
  cur = db.executeQuery("select * from user;");
  Row currentRow= cur.getRow();
  String dataText = currentRow.getString(0);
  txt.setText(dataText);
  </code></pre>
  
  <p>I tried to establish a connection to a database on my localhost using the following code, as a prototype to an online connection:</p>
  
  <pre><code>String path = Display.getInstance().getDatabasePath("http://localhost/MyDB.db");
  db = Display.getInstance().openOrCreate(path);
  cur = db.executeQuery("select * from user;");
  Row currentRow= cur.getRow();
  String dataText = currentRow.getString(0);
  txt.setText(dataText);
  </code></pre>
  
  <p>This was giving an error and the connection was not successful.</p>
  
  <p>How can we connect to an online database using the provided codes?</p>