title: java.sql.SQLException: ORA-01000: maximum open cursors exceeded while truncating tables
body: <p>I get this exception while truncating all table in a schema.<br>
  I truncate 3 schema in my Java code and first method get list of table names from given schema name and second method executes <strong>"TRUNCATE TABLE table_name"</strong> query.<br>
  I confused about my code always succesful while truncating first and third schema. But while executing on second schema I get <strong>ORA-01000</strong> error.<br>
  My truncate code is </p>
  
  <pre><code>    private void truncateTable(Connection conn, String tableName) {
      PreparedStatement ps = null;
      try {
          ps = conn.prepareStatement(Utility.TRUNCATE_TABLE + tableName);
          ps.executeUpdate();
      } catch (SQLException e) {
          log.error("SQLException occured while getting table names from schema", e);
      } finally {
          Utility.free(ps, null, null);
      }
  }
  
  
      private List&lt;String&gt; getAllTableNames(Connection conn) {
      PreparedStatement ps = null;
      ResultSet rs = null;
      List&lt;String&gt; list = new ArrayList&lt;String&gt;();
      try {
          ps = conn.prepareStatement(Utility.SELECT_ALL_TABLE_NAMES);
          rs = ps.executeQuery();
          while (rs.next()) {
              list.add(rs.getString("TABLE_NAME"));
          }
      } catch (SQLException e) {
          log.error("SQLException occured while getting table names from schema", e);
      } finally {
          Utility.free(ps, rs, null);
      }
      return list;
  }
  
      public static void free(PreparedStatement ps, ResultSet rs, Connection conn) {
      if (rs != null) {
          try {
              rs.close();
          } catch (SQLException e) {
              log.error("Error occurred while closing ResultSet",e);
          }
      }
      if (ps != null) {
          try {
              ps.close();
          } catch (SQLException e) {
              log.error("Error occurred while closing PreparedStatement",e);
          }
      }
      if (conn != null) {
          try {
              conn.close();
          } catch (SQLException e) {
              log.error("Error occurred while closing Connection",e);
          }
      }
  }
  </code></pre>
  
  <p>What is the wrong about code or is it about schema configuraiton in Oracle?
  How can I solve this?</p>