Elexis API documentation
Version 2.1.6 as of December 11 2011

com.healthmarketscience.jackcess
Class ImportUtil

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

public class ImportUtil
extends java.lang.Object

Author:
James Ahlborn

Method Summary
static java.lang.String importFile(java.io.File f, Database db, java.lang.String name, java.lang.String delim)
          Copy a delimited text file into a new table in this database Equivalent to: importFile(f, name, db, delim, SimpleImportFilter.INSTANCE);
static java.lang.String importFile(java.io.File f, Database db, java.lang.String name, java.lang.String delim, ImportFilter filter)
          Copy a delimited text file into a new table in this database Equivalent to: importReader(new BufferedReader(new FileReader(f)), db, name, delim, filter);
static java.lang.String importReader(java.io.BufferedReader in, Database db, java.lang.String name, java.lang.String delim)
          Copy a delimited text file into a new table in this database Equivalent to: importReader(in, db, name, delim, SimpleImportFilter.INSTANCE);
static java.lang.String importReader(java.io.BufferedReader in, Database db, java.lang.String name, java.lang.String delim, ImportFilter filter)
          Copy a delimited text file into a new table in this database Equivalent to: importReader(in, db, name, delim, filter, false);
static java.lang.String importReader(java.io.BufferedReader in, Database db, java.lang.String name, java.lang.String delim, ImportFilter filter, boolean useExistingTable)
          Copy a delimited text file into a new (or optionally exixsting) table in this database
static java.lang.String importResultSet(java.sql.ResultSet source, Database db, java.lang.String name)
          Copy an existing JDBC ResultSet into a new table in this database Equivalent to: importResultSet(source, db, name, SimpleImportFilter.INSTANCE);
static java.lang.String importResultSet(java.sql.ResultSet source, Database db, java.lang.String name, ImportFilter filter)
          Copy an existing JDBC ResultSet into a new table in this database Equivalent to: importResultSet(source, db, name, filter, false);
static java.lang.String importResultSet(java.sql.ResultSet source, Database db, java.lang.String name, ImportFilter filter, boolean useExistingTable)
          Copy an existing JDBC ResultSet into a new (or optionally existing) table in this database
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

importResultSet

public static java.lang.String importResultSet(java.sql.ResultSet source,
                                               Database db,
                                               java.lang.String name)
                                        throws java.sql.SQLException,
                                               java.io.IOException
Copy an existing JDBC ResultSet into a new table in this database

Equivalent to: importResultSet(source, db, name, SimpleImportFilter.INSTANCE);

Parameters:
name - Name of the new table to create
source - ResultSet to copy from
Returns:
the name of the copied table
Throws:
java.sql.SQLException
java.io.IOException
See Also:
importResultSet(ResultSet,Database,String,ImportFilter)

importResultSet

public static java.lang.String importResultSet(java.sql.ResultSet source,
                                               Database db,
                                               java.lang.String name,
                                               ImportFilter filter)
                                        throws java.sql.SQLException,
                                               java.io.IOException
Copy an existing JDBC ResultSet into a new table in this database

Equivalent to: importResultSet(source, db, name, filter, false);

Parameters:
name - Name of the new table to create
source - ResultSet to copy from
filter - valid import filter
Returns:
the name of the imported table
Throws:
java.sql.SQLException
java.io.IOException
See Also:
importResultSet(ResultSet,Database,String,ImportFilter,boolean)

importResultSet

public static java.lang.String importResultSet(java.sql.ResultSet source,
                                               Database db,
                                               java.lang.String name,
                                               ImportFilter filter,
                                               boolean useExistingTable)
                                        throws java.sql.SQLException,
                                               java.io.IOException
Copy an existing JDBC ResultSet into a new (or optionally existing) table in this database

Parameters:
name - Name of the new table to create
source - ResultSet to copy from
filter - valid import filter
useExistingTable - if true use current table if it already exists, otherwise, create new table with unique name
Returns:
the name of the imported table
Throws:
java.sql.SQLException
java.io.IOException

importFile

public static java.lang.String importFile(java.io.File f,
                                          Database db,
                                          java.lang.String name,
                                          java.lang.String delim)
                                   throws java.io.IOException
Copy a delimited text file into a new table in this database

Equivalent to: importFile(f, name, db, delim, SimpleImportFilter.INSTANCE);

Parameters:
name - Name of the new table to create
f - Source file to import
delim - Regular expression representing the delimiter string.
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
importFile(File,Database,String,String,ImportFilter)

importFile

public static java.lang.String importFile(java.io.File f,
                                          Database db,
                                          java.lang.String name,
                                          java.lang.String delim,
                                          ImportFilter filter)
                                   throws java.io.IOException
Copy a delimited text file into a new table in this database

Equivalent to: importReader(new BufferedReader(new FileReader(f)), db, name, delim, filter);

Parameters:
name - Name of the new table to create
f - Source file to import
delim - Regular expression representing the delimiter string.
filter - valid import filter
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
importReader(BufferedReader,Database,String,String,ImportFilter)

importReader

public static java.lang.String importReader(java.io.BufferedReader in,
                                            Database db,
                                            java.lang.String name,
                                            java.lang.String delim)
                                     throws java.io.IOException
Copy a delimited text file into a new table in this database

Equivalent to: importReader(in, db, name, delim, SimpleImportFilter.INSTANCE);

Parameters:
name - Name of the new table to create
in - Source reader to import
delim - Regular expression representing the delimiter string.
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
importReader(BufferedReader,Database,String,String,ImportFilter)

importReader

public static java.lang.String importReader(java.io.BufferedReader in,
                                            Database db,
                                            java.lang.String name,
                                            java.lang.String delim,
                                            ImportFilter filter)
                                     throws java.io.IOException
Copy a delimited text file into a new table in this database

Equivalent to: importReader(in, db, name, delim, filter, false);

Parameters:
name - Name of the new table to create
in - Source reader to import
delim - Regular expression representing the delimiter string.
filter - valid import filter
Returns:
the name of the imported table
Throws:
java.io.IOException
See Also:
importReader(BufferedReader,Database,String,String,ImportFilter,boolean)

importReader

public static java.lang.String importReader(java.io.BufferedReader in,
                                            Database db,
                                            java.lang.String name,
                                            java.lang.String delim,
                                            ImportFilter filter,
                                            boolean useExistingTable)
                                     throws java.io.IOException
Copy a delimited text file into a new (or optionally exixsting) table in this database

Parameters:
name - Name of the new table to create
in - Source reader to import
delim - Regular expression representing the delimiter string.
filter - valid import filter
useExistingTable - if true use current table if it already exists, otherwise, create new table with unique name
Returns:
the name of the imported table
Throws:
java.io.IOException

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis