Klasse CsvToSqlExtensions

java.lang.Object
io.github.astrapisixtynine.csv.CsvToSqlExtensions

public final class CsvToSqlExtensions extends Object
  • Methodendetails

    • extractSqlColumns

      public static String extractSqlColumns(String[] headers)
      Extract sql columns.
      Parameter:
      headers - the headers
      Gibt zurück:
      the string
    • getCsvFileAsSqlInsertScript

      public static String getCsvFileAsSqlInsertScript(String tableName, CsvBean csvBean)
      Gets the csv file as sql insert script.
      Parameter:
      tableName - the table name
      csvBean - 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 name
      csvBean - the csv bean
      withHeader - the with header
      withEndSemicolon - 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 name
      headers - the headers
      columnTypes - the column types
      lines - 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 name
      headers - the headers
      columnTypes - the column types
      columnTypesEdit - the column types edit
      lines - the lines
      Gibt zurück:
      the csv file as sql insert script
    • getDataFromLine

      public static String[] getDataFromLine(String line, String seperator)
      Gets the data from line.
      Parameter:
      line - the line
      seperator - 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 columns
      columnTypes - the column types
      columnTypesEdit - the column types edit
      lineOrder - the line order
      lines - the lines
      withEndSemicolon - the with end semicolon
      Gibt zurück:
      the sql data