title: Connect a java program to a remote oracle database
body: <p>I want to establish a connection between my java program and my oracle server that I installed on a virtual machine of my PC.I try the following code :</p>
  
  <pre><code> connection=DriverManager.getConnection("jdbc:oracle:thin:@server:1521:dbname", "user", "password");
  </code></pre>
  
  <p>but here is the error:</p>
  
  <pre><code>java.sql.SQLRecoverableException: Erreur d'E/S: The Network Adapter could not establish the connection.
  </code></pre>
  
  <p>I have nothing to install on my client machine other than my tools to develop java. My listener is started here its contents:</p>
  
  <pre><code>TST=
   (DESCRIPTION = 
    (ADDRESS+ (PROTOCOL = TCP) (HOST = oracleserver.domainesa)(PORT = 1521))
    (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = TST)
  )
  )
  </code></pre>
  
  <p>where oracleserver is the name of my server.
  please help me.</p>