title: Best practices for working with multiple tables
body: <p>I use a database with multiple tables in my application. I have an XML parser which needs to write data to two tables while parsing. I created two database adapters for both tables, but now I have a problem. When I'm working with one table, it's easy:</p>
  
  <pre><code>FirstDBAdapter firstTable = new FirstDBAdapter(mycontext);
  firstTable.open(); // open and close it every time I need to insert something
                     // may be hundreds of times while parsing
                     // it opens not a table but whole DB     
  firstTable.insertItem(Item);        
  firstTable.close(); 
  </code></pre>
  
  <p>Since it's a SAX parser, in my opinion (maybe I'm wrong), this will be even better:</p>
  
  <pre><code>FirstDBAdapter firstTable = new FirstDBAdapter(mycontext);
  
  @Override
  public void startDocument() throws SAXException 
  {
      firstTable.open(); // open and close only once
  }
  
  ...
  firstTable.insertItem(Item);
  ...
  
  @Override
  public void endDocument() throws SAXException 
  {
      firstTable.close();
  }
  </code></pre>
  
  <p>But how do I do it if I need to insert data to the second table? For example, if I have the second adapter, which  I think will be a bad idea:</p>
  
  <pre><code>FirstDBAdapter firstTable = new FirstDBAdapter(mycontext);
  SecondDBAdapter secondTable = new SecondDBAdapter(mycontext);
  
  @Override
  public void startDocument() throws SAXException 
  {
      firstTable.open();
      secondTable.open(); 
  }
  </code></pre>
  
  <p>Any thoughts on how to achieve this?</p>