Package io.github.astrapisixtynine.csv
Klasse CsvToSqlExtensions
java.lang.Object
io.github.astrapisixtynine.csv.CsvToSqlExtensions
The class
CsvToSqlExtensions
.-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic 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, String[] columnTypesEdit, List<String[]> lines) 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[]
getDataFromLine
(String line, String seperator) Gets the data from line.static StringBuilder
getSqlData
(String[] columns, String[] columnTypes, String[] columnTypesEdit, Map<Integer, Integer> lineOrder, List<String[]> lines, boolean withEndSemicolon) Gets the sql data.
-
Methodendetails
-
extractSqlColumns
Extract sql columns.- Parameter:
headers
- the headers- Gibt zurück:
- the string
-
getCsvFileAsSqlInsertScript
Gets the csv file as sql insert script.- Parameter:
tableName
- the table namecsvBean
- the csv bean- Gibt zurück:
- the csv file as sql insert script
-
getCsvFileAsSqlInsertScript
public static String getCsvFileAsSqlInsertScript(String tableName, CsvBean csvBean, boolean withHeader, boolean withEndSemicolon) Gets the csv file as sql insert script.- Parameter:
tableName
- the table namecsvBean
- the csv beanwithHeader
- the with headerwithEndSemicolon
- the with end semicolon- Gibt zurück:
- the csv file as sql insert script
-
getCsvFileAsSqlInsertScript
public static String getCsvFileAsSqlInsertScript(String tableName, String[] headers, String[] columnTypes, List<String[]> lines) Gets the csv file as sql insert script.- Parameter:
tableName
- the table nameheaders
- the headerscolumnTypes
- the column typeslines
- the lines- Gibt zurück:
- the csv file as sql insert script
-
getCsvFileAsSqlInsertScript
public static String getCsvFileAsSqlInsertScript(String tableName, String[] headers, String[] columnTypes, String[] columnTypesEdit, List<String[]> lines) Gets the csv file as sql insert script.- Parameter:
tableName
- the table nameheaders
- the headerscolumnTypes
- the column typescolumnTypesEdit
- the column types editlines
- the lines- Gibt zurück:
- the csv file as sql insert script
-
getDataFromLine
Gets the data from line.- Parameter:
line
- the lineseperator
- the seperator- Gibt zurück:
- the data from line
-
getSqlData
public static StringBuilder getSqlData(String[] columns, String[] columnTypes, String[] columnTypesEdit, Map<Integer, Integer> lineOrder, List<String[]> lines, boolean withEndSemicolon) Gets the sql data.- Parameter:
columns
- the columnscolumnTypes
- the column typescolumnTypesEdit
- the column types editlineOrder
- the line orderlines
- the lineswithEndSemicolon
- the with end semicolon- Gibt zurück:
- the sql data
-