importWorkbookToSchema

open override fun importWorkbookToSchema(pathToWorkbook: Path, tableNames: List<String>, schemaName: String?, skipFirstRow: Boolean)

Opens the workbook for reading only and writes the sheets of the workbook into database tables. The list of names is the names of the sheets in the workbook and the names of the tables that need to be written. They are in the order that is required for entering data so that no integrity constraints are violated. The underlying workbook is closed after the operation.

Uses the longLastingConnection property for the connection for metadata checking.

Parameters

pathToWorkbook

the path to the workbook. Must be valid workbook with .xlsx extension

skipFirstRow

if true the first row of each sheet is skipped

schemaName

the name of the schema containing the named tables

tableNames

the names of the sheets and tables in the order that needs to be written

Throws

an io exception