Elexis API documentation
Version 2.1.6 as of December 11 2011

com.healthmarketscience.jackcess
Class ExportUtil

java.lang.Object
  extended by com.healthmarketscience.jackcess.ExportUtil

public class ExportUtil
extends java.lang.Object

Author:
Frank Gerbig

Field Summary
static java.lang.String DEFAULT_DELIMITER
           
static java.lang.String DEFAULT_FILE_EXT
           
static char DEFAULT_QUOTE_CHAR
           
 
Method Summary
static void exportAll(Database db, java.io.File dir)
          Copy all tables into new delimited text files
Equivalent to: exportAll(db, dir, "csv");
static void exportAll(Database db, java.io.File dir, java.lang.String ext)
          Copy all tables into new delimited text files
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);
static void exportAll(Database db, java.io.File dir, java.lang.String ext, boolean header)
          Copy all tables into new delimited text files
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);
static void exportAll(Database db, java.io.File dir, java.lang.String ext, boolean header, java.lang.String delim, char quote, ExportFilter filter)
          Copy all tables into new delimited text files
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);
static void exportFile(Database db, java.lang.String tableName, java.io.File f)
          Copy a table into a new delimited text file
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);
static void exportFile(Database db, java.lang.String tableName, java.io.File f, boolean header, java.lang.String delim, char quote, ExportFilter filter)
          Copy a table into a new delimited text file
Nearly equivalent to: exportWriter(db, name, new BufferedWriter(f), header, delim, quote, filter);
static void exportWriter(Cursor cursor, java.io.BufferedWriter out, boolean header, java.lang.String delim, char quote, ExportFilter filter)
          Copy a table in this database into a new delimited text file.
static void exportWriter(Database db, java.lang.String tableName, java.io.BufferedWriter out)
          Copy a table in this database into a new delimited text file
Equivalent to: exportWriter(db, name, out, false, null, '"', SimpleExportFilter.INSTANCE);
static void exportWriter(Database db, java.lang.String tableName, java.io.BufferedWriter out, boolean header, java.lang.String delim, char quote, ExportFilter filter)
          Copy a table in this database into a new delimited text file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DELIMITER

public static final java.lang.String DEFAULT_DELIMITER
See Also:
Constant Field Values

DEFAULT_QUOTE_CHAR

public static final char DEFAULT_QUOTE_CHAR
See Also:
Constant Field Values

DEFAULT_FILE_EXT

public static final java.lang.String DEFAULT_FILE_EXT
See Also:
Constant Field Values
Method Detail

exportAll

public static void exportAll(Database db,
                             java.io.File dir)
                      throws java.io.IOException
Copy all tables into new delimited text files
Equivalent to: exportAll(db, dir, "csv");

Parameters:
db - Database the table to export belongs to
dir - The directory where the new files will be created
Throws:
java.io.IOException
See Also:
exportAll(Database,File,String)

exportAll

public static void exportAll(Database db,
                             java.io.File dir,
                             java.lang.String ext)
                      throws java.io.IOException
Copy all tables into new delimited text files
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);

Parameters:
db - Database the table to export belongs to
dir - The directory where the new files will be created
ext - The file extension of the new files
Throws:
java.io.IOException
See Also:
exportFile(Database,String,File,boolean,String,char,ExportFilter)

exportAll

public static void exportAll(Database db,
                             java.io.File dir,
                             java.lang.String ext,
                             boolean header)
                      throws java.io.IOException
Copy all tables into new delimited text files
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);

Parameters:
db - Database the table to export belongs to
dir - The directory where the new files will be created
ext - The file extension of the new files
header - If true the first line contains the column names
Throws:
java.io.IOException
See Also:
exportFile(Database,String,File,boolean,String,char,ExportFilter)

exportAll

public static void exportAll(Database db,
                             java.io.File dir,
                             java.lang.String ext,
                             boolean header,
                             java.lang.String delim,
                             char quote,
                             ExportFilter filter)
                      throws java.io.IOException
Copy all tables into new delimited text files
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);

Parameters:
db - Database the table to export belongs to
dir - The directory where the new files will be created
ext - The file extension of the new files
header - If true the first line contains the column names
delim - The column delimiter, null for default (comma)
quote - The quote character
filter - valid export filter
Throws:
java.io.IOException
See Also:
exportFile(Database,String,File,boolean,String,char,ExportFilter)

exportFile

public static void exportFile(Database db,
                              java.lang.String tableName,
                              java.io.File f)
                       throws java.io.IOException
Copy a table into a new delimited text file
Equivalent to: exportFile(db, name, f, false, null, '"', SimpleExportFilter.INSTANCE);

Parameters:
db - Database the table to export belongs to
tableName - Name of the table to export
f - New file to create
Throws:
java.io.IOException
See Also:
exportFile(Database,String,File,boolean,String,char,ExportFilter)

exportFile

public static void exportFile(Database db,
                              java.lang.String tableName,
                              java.io.File f,
                              boolean header,
                              java.lang.String delim,
                              char quote,
                              ExportFilter filter)
                       throws java.io.IOException
Copy a table into a new delimited text file
Nearly equivalent to: exportWriter(db, name, new BufferedWriter(f), header, delim, quote, filter);

Parameters:
db - Database the table to export belongs to
tableName - Name of the table to export
f - New file to create
header - If true the first line contains the column names
delim - The column delimiter, null for default (comma)
quote - The quote character
filter - valid export filter
Throws:
java.io.IOException
See Also:
exportWriter(Database,String,BufferedWriter,boolean,String,char,ExportFilter)

exportWriter

public static void exportWriter(Database db,
                                java.lang.String tableName,
                                java.io.BufferedWriter out)
                         throws java.io.IOException
Copy a table in this database into a new delimited text file
Equivalent to: exportWriter(db, name, out, false, null, '"', SimpleExportFilter.INSTANCE);

Parameters:
db - Database the table to export belongs to
tableName - Name of the table to export
out - Writer to export to
Throws:
java.io.IOException
See Also:
exportWriter(Database,String,BufferedWriter,boolean,String,char,ExportFilter)

exportWriter

public static void exportWriter(Database db,
                                java.lang.String tableName,
                                java.io.BufferedWriter out,
                                boolean header,
                                java.lang.String delim,
                                char quote,
                                ExportFilter filter)
                         throws java.io.IOException
Copy a table in this database into a new delimited text file.
Equivalent to: exportWriter(Cursor.createCursor(db.getTable(tableName)), out, header, delim, quote, filter);

Parameters:
db - Database the table to export belongs to
tableName - Name of the table to export
out - Writer to export to
header - If true the first line contains the column names
delim - The column delimiter, null for default (comma)
quote - The quote character
filter - valid export filter
Throws:
java.io.IOException
See Also:
exportWriter(Cursor,BufferedWriter,boolean,String,char,ExportFilter)

exportWriter

public static void exportWriter(Cursor cursor,
                                java.io.BufferedWriter out,
                                boolean header,
                                java.lang.String delim,
                                char quote,
                                ExportFilter filter)
                         throws java.io.IOException
Copy a table in this database into a new delimited text file.

Parameters:
cursor - Cursor to export
out - Writer to export to
header - If true the first line contains the column names
delim - The column delimiter, null for default (comma)
quote - The quote character
filter - valid export filter
Throws:
java.io.IOException

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis