public final class CsvToSqlExtensions extends Object
CsvToSqlExtensions.| Constructor and Description |
|---|
CsvToSqlExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static String |
extractSqlColumns(String[] headers)
Extract sql columns.
|
static String |
getCsvFileAsSqlInsertScript(String tableName,
CsvBean csvBean)
Gets the csv file as sql insert script.
|
static String |
getCsvFileAsSqlInsertScript(String tableName,
CsvBean csvBean,
boolean withHeader,
boolean withEndSemicolon)
Gets the csv file as sql insert script.
|
static String |
getCsvFileAsSqlInsertScript(String tableName,
String[] headers,
String[] columnTypes,
List<String[]> lines)
Gets the csv file as sql insert script.
|
static String |
getCsvFileAsSqlInsertScript(String tableName,
String[] headers,
String[] columnTypes,
String[] columnTypesEdit,
List<String[]> lines)
Gets the csv file as sql insert script.
|
static String[] |
getDataFromLine(String line,
String seperator)
Gets the data from line.
|
static StringBuffer |
getSqlData(String[] columns,
String[] columnTypes,
String[] columnTypesEdit,
Map<Integer,Integer> lineOrder,
List<String[]> lines,
boolean withEndSemicolon)
Gets the sql data.
|
public static String extractSqlColumns(String[] headers)
headers - the headerspublic static String getCsvFileAsSqlInsertScript(String tableName, CsvBean csvBean)
tableName - the table namecsvBean - the csv beanpublic static String getCsvFileAsSqlInsertScript(String tableName, CsvBean csvBean, boolean withHeader, boolean withEndSemicolon)
tableName - the table namecsvBean - the csv beanwithHeader - the with headerwithEndSemicolon - the with end semicolonpublic static String getCsvFileAsSqlInsertScript(String tableName, String[] headers, String[] columnTypes, List<String[]> lines)
tableName - the table nameheaders - the headerscolumnTypes - the column typeslines - the linespublic static String getCsvFileAsSqlInsertScript(String tableName, String[] headers, String[] columnTypes, String[] columnTypesEdit, List<String[]> lines)
tableName - the table nameheaders - the headerscolumnTypes - the column typescolumnTypesEdit - the column types editlines - the linespublic static String[] getDataFromLine(String line, String seperator)
line - the lineseperator - the seperatorpublic static StringBuffer getSqlData(String[] columns, String[] columnTypes, String[] columnTypesEdit, Map<Integer,Integer> lineOrder, List<String[]> lines, boolean withEndSemicolon)
columns - the columnscolumnTypes - the column typescolumnTypesEdit - the column types editlineOrder - the line orderlines - the lineswithEndSemicolon - the with end semicolonCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.