Codota Logo
TableDataReader
Code IndexAdd Codota to your IDE (free)

How to use
TableDataReader
in
org.eclipse.dirigible.database.ds.model.transfer

Best Java code snippets using org.eclipse.dirigible.database.ds.model.transfer.TableDataReader (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: org.eclipse.dirigible/dirigible-database-data-models

public static List<String[]> readRecords(InputStream csvFile)
    throws FileNotFoundException, IOException, InvalidNumberOfElementsException {
  BufferedReader reader = new BufferedReader(new InputStreamReader(csvFile, StandardCharsets.UTF_8));
  List<String[]> data = new ArrayList<String[]>();
  int item_count = -1;
  int line_number = 0;
  while (true) {
    String line = reader.readLine();
    line_number++;
    if (line == null) {
      break;
    }
    String[] items = getStringItems(line);
    if (item_count == -1) {
      item_count = items.length;
    } else if (item_count != items.length) {
      throw new InvalidNumberOfElementsException(
          String.format(INVALID_NUMBER_D_OF_ELEMENTS_AT_LINE_D_INITIAL_COLUMNS_NUMBER_D, items.length,
              line_number, item_count));
    }
    data.add(items);
  }
  reader.close();
  return data;
}
origin: org.eclipse.dirigible/dirigible-database-data-models

public void insert() throws Exception {
  Connection connection = null;
  try {
    connection = getConnection();
    List<String[]> records = TableDataReader.readRecords(new ByteArrayInputStream(content));
    insertRecords(connection, records, tableName);
  } finally {
    closeConnection(connection);
  }
}
origin: org.eclipse.dirigible/dirigible-database-data-structures

private void deleteRowsDataFromTable(String tableName, String primaryKey, byte[] fileContent) throws Exception {
  Connection connection = null;
  try {
    connection = dataSource.getConnection();
    List<String[]> records = TableDataReader.readRecords(new ByteArrayInputStream(fileContent));
    for (String[] record : records) {
      if (record.length > 0) {
        String sql = SqlFactory.getNative(connection).delete().from(tableName).where(primaryKey + " = ?").build();
        PreparedStatement deleteStatement = connection.prepareStatement(sql);
        deleteStatement.setObject(1, record[0]);
        deleteStatement.execute();
      } else {
        logger.error(String.format("Skipping deletion of an empty data row for table: %s", tableName));
      }
    }
  } finally {
    if (connection != null) {
      connection.close();
    }
  }
}
origin: org.eclipse.dirigible/dirigible-database-data-structures

try {
  connection = dataSource.getConnection();
  List<String[]> records = TableDataReader.readRecords(new ByteArrayInputStream(fileContent));
  for (String[] record : records) {
    if (record.length > 0) {
org.eclipse.dirigible.database.ds.model.transferTableDataReader

Most used methods

  • readRecords
  • getStringItems

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now