private void exportDBTables(Connection con) throws AdeException {
  logger.debug("Starting to export tables to DB.");
  final String fileNamesQueryStr=DB_QUERY_FOR_FILENAMES;
  Statement statement=null;
  ResultSet rs=null;
  PreparedStatement ps=null;
  try {
    statement=getStatement(con);
    rs=executeQuery(statement,fileNamesQueryStr);
    while (rs != null && rs.next()) {
      final String tableName=rs.getString(1);
      final String ffdcFileName=formFFDCDBExportedTableFileName(tableName);
      final File f=new File(ffdcFileName);
      if (f.exists()) {
        f.delete();
      }
      if (!tableName.equals(MESSAGE_SUMMARIES_TABLE)) {
        logger.debug("Exporting table  " + tableName + " to file "+ ffdcFileName);
        ps=con.prepareStatement(DB_QUERY_TO_EXPORT_DB_FILE);
        ps.setString(1,null);
        ps.setString(2,tableName);
        ps.setString(3,ffdcFileName);
        ps.setString(4,",");
        ps.setString(5,null);
        ps.setString(6,null);
        ps.execute();
      }
 else {
        readMessageSummariesTable(con);
      }
    }
  }
 catch (  SQLException e) {
    throw new AdeExtInternalException("Got an SQL exception=" + e);
  }
catch (  AdeException e) {
    throw e;
  }
 finally {
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
        logger.error("Exception in closing result set.",e);
      }
    }
    if (statement != null) {
      try {
        statement.close();
      }
 catch (      SQLException e) {
        logger.error("Exception in closing statement.",e);
      }
    }
    if (ps != null) {
      try {
        ps.close();
      }
 catch (      SQLException e) {
        logger.error("Exception in closing statement.",e);
      }
    }
  }
}

private void exportDBTables ( Connection con ) throws AdeException { logger . debug ( "Starting to export tables to DB." ) ; final String fileNamesQueryStr = DB_QUERY_FOR_FILENAMES ; Statement statement = null ; ResultSet rs = null ; PreparedStatement ps = null ; try { statement = getStatement ( con ) ; rs = executeQuery ( statement , fileNamesQueryStr ) ; while ( rs != null && rs . next ( ) ) { final String tableName = rs . getString ( 1 ) ; final String ffdcFileName = formFFDCDBExportedTableFileName ( tableName ) ; final File f = new File ( ffdcFileName ) ; if ( f . exists ( ) ) { f . delete ( ) ; } if ( ! tableName . equals ( MESSAGE_SUMMARIES_TABLE ) ) { logger . debug ( "Exporting table  " + tableName + " to file " + ffdcFileName ) ; ps = con . prepareStatement ( DB_QUERY_TO_EXPORT_DB_FILE ) ; ps . setString ( 1 , null ) ; ps . setString ( 2 , tableName ) ; ps . setString ( 3 , ffdcFileName ) ; ps . setString ( 4 , "," ) ; ps . setString ( 5 , null ) ; ps . setString ( 6 , null ) ; ps . execute ( ) ; } else { readMessageSummariesTable ( con ) ; } } } catch ( SQLException e ) { throw new AdeExtInternalException ( "Got an SQL exception=" + e ) ; } catch ( AdeException e ) { throw e ; } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { logger . error ( "Exception in closing result set." , e ) ; } } if ( statement != null ) { try { statement . close ( ) ; } catch ( SQLException e ) { logger . error ( "Exception in closing statement." , e ) ; } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { logger . error ( "Exception in closing statement." , e ) ; } } } }
exports all tables into flat files .
