title: Problem changing Database in Hibernate
body: <p>i'm having a problem with hibernate and don't know exactly what's going on, i have this project at work where i connect to an Oracle 10g Database using the following settings:</p>
  
  <pre><code>Host Name: localhost
  port:1521
  SID:orcl
  user:anfxi
  password:password
  </code></pre>
  
  <p>Now i'm at home trying to work with the same database remotely, im connected via VPN and the database ip is now <code>10.73.98.230</code> , i imported my WAR and changed the settings in my 
  hibernate.cfg.xml from:</p>
  
  <pre><code>&lt;property name="hibernate.connection.driver_class"&gt;oracle.jdbc.OracleDriver&lt;/property&gt;
  &lt;property name="hibernate.connection.url"&gt;jdbc:oracle:thin://localhost:1521:orcl&lt;/property&gt;
  &lt;property name="hibernate.connection.username"&gt;anfexi&lt;/property&gt;
  &lt;property name="connection.password"&gt;password&lt;/property&gt;
  &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.OracleDialect&lt;/property&gt;
  &lt;property name="show_sql"&gt;true&lt;/property&gt;
  &lt;property name="hbm2ddl.auto"&gt;validate&lt;/property&gt;
  &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  </code></pre>
  
  <p>to: </p>
  
  <pre><code>&lt;property name="hibernate.connection.driver_class"&gt;oracle.jdbc.OracleDriver&lt;/property&gt;
  &lt;property name="hibernate.connection.url"&gt;jdbc:oracle:thin://10.73.98.230:1521:orcl&lt;/property&gt;
  &lt;property name="hibernate.connection.username"&gt;anfexi&lt;/property&gt;
  &lt;property name="connection.password"&gt;password&lt;/property&gt;
  &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.OracleDialect&lt;/property&gt;
  &lt;property name="show_sql"&gt;true&lt;/property&gt;
  &lt;property name="hbm2ddl.auto"&gt;validate&lt;/property&gt;
  &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  </code></pre>
  
  <p>but i keep getting this error: </p>
  
  <pre><code>ERROR [main] (SchemaValidator.java:135) - could not get database metadata
  java.sql.SQLException: Listener refused the connection with the following error:
  ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
  The Connection descriptor used by the client was:
  localhost:1521:orcl
  </code></pre>
  
  <p>so it seems to be still using localhost as the DB address, i cleaned my project and rebuilt, still with no luck, is there something else that i could be missing? does the hibernate configuration gets cached in some file i have to erase or something?</p>
  
  <p><strong>EDIT</strong>
  For what it may serve, i can connect using SQL developer,the problem is just hibernate still using the old <code>localhost:1521:orcl</code> Connection descriptor. </p>
  
  <p>Thanks for your help!</p>