title: ORA-00942: table or view does not exist error on writing to a table in database
body: <p>I am trying to read a data from one database table using java + jdbc and trying to insert into another database table on different server in same session.</p>
  
  <p>I have created 2 connection object(con,conn1), each pointing to correct database.
  With 1st con object i am able to read the data but  When it is going to write the data to another table using conn1 it is failing with error<br>
  ORA-00942- table or view doesnt exist.</p>
  
  <p>I have also cross-checked that table is present and we can write to that table.
  with a standalone class and static data i was able to write to that table.</p>
  
  <p>Please let me know what is wrong in my approach.</p>
  
  <p>Code sample:</p>
  
  <p>public static void main</p>
  
  <pre><code>Class.forName("oracle.jdbc.driver.OracleDriver");
          Connection con = DriverManager.getConnection( "URL","uname","passwd");
  </code></pre>
  
  <p>//code to read from db and add to arraylist.
  close resultset, con.</p>
  
  <p>This connection obj points to new a database and url</p>
  
  <p>Connection con1 = DriverManager.getConnection( "url","uname","passwd");
          PreparedStatement pstmt = con1.prepareStatement("insert into SCHEMA_NAME.TABLE_NAME(columns) values(?,?,?,?,?,?,?,?)");</p>
  
  <p>//code to iterate the arraylist populated above</p>
  
  <pre><code>pstmt.setint etc 
  pstmt.executeUpdate();
  </code></pre>
  
  <p>It fails after executeUpdate statement.</p>