Tabnine Logo
DataBaseConnector.tableExists
Code IndexAdd Tabnine to your IDE (free)

How to use
tableExists
method
in
de.julielab.xmlData.dataBase.DataBaseConnector

Best Java code snippets using de.julielab.xmlData.dataBase.DataBaseConnector.tableExists (Showing top 7 results out of 315)

origin: de.julielab/jcore-db-reader

private void checkTableExists() throws ResourceInitializationException {
  // Check whether the table we are supposed to read from actually exists.
  if (!dbc.withConnectionQueryBoolean(c -> c.tableExists(tableName))) {
    throw new ResourceInitializationException(
        new IllegalArgumentException("The configured table \"" + tableName + "\" does not exist."));
  }
}
origin: de.julielab/jcore-db-reader

  String tableName = rawTableName.replaceAll("\\.", "_");
  resultTableName = schema + "." + tableName;
} else if (dbc.tableExists(rawName)) {
  resultTableName = rawName;
} else if (dbc.tableExists(additionalTablesPGSchema + "." + rawName.replaceAll("\\.", "_"))) {
  resultTableName = additionalTablesPGSchema + "." + rawName.replaceAll("\\.", "_");
origin: de.julielab/jcore-xmi-db-writer

private void createNamespaceTable(DataBaseConnector dbc) {
  if (!dbc.tableExists(dbc.getActiveDataPGSchema() + "." + XMI_NS_TABLE)) {
     try (CoStoSysConnection conn = dbc.obtainOrReserveConnection()){
      conn.setAutoCommit(true);
      Statement stmt = conn.createStatement();
      String sql = String.format("CREATE TABLE %s (%s text PRIMARY KEY, %s text)", dbc.getActiveDataPGSchema() + "." + XMI_NS_TABLE, PREFIX, NS_URI);
      stmt.execute(sql);
    } catch (SQLException e) {
      e.printStackTrace();
      SQLException ne = e.getNextException();
      if (null != ne)
        ne.printStackTrace();
    }
  }
}
origin: de.julielab/jcore-xmi-db-reader

private Map<String, String> getNamespaceMap() {
  Map<String, String> map = null;
  if (dbc.tableExists(dbc.getActiveDataPGSchema() + "." + XmiSplitConstants.XMI_NS_TABLE)) {
    try (CoStoSysConnection conn = dbc.obtainOrReserveConnection()){
      map = new HashMap<>();
      conn.setAutoCommit(true);
      Statement stmt = conn.createStatement();
      String sql = String.format("SELECT %s,%s FROM %s", XmiSplitConstants.PREFIX, XmiSplitConstants.NS_URI,
          dbc.getActiveDataPGSchema() + "." + XmiSplitConstants.XMI_NS_TABLE);
      ResultSet rs = stmt.executeQuery(String.format(sql));
      while (rs.next())
        map.put(rs.getString(1), rs.getString(2));
    } catch (SQLException e) {
      e.printStackTrace();
      SQLException ne = e.getNextException();
      if (null != ne)
        ne.printStackTrace();
    }
  } else {
    log.warn(
        "Table \"{}\" was not found it is assumed that the table from which is read contains complete XMI documents.",
        dbc.getActiveDataPGSchema() + "." + XmiSplitConstants.XMI_NS_TABLE);
  }
  return map;
}
origin: de.julielab/jcore-xmi-db-writer

  private void createAnnotationListTable() {
    if (!dbc.tableExists(dbc.getActiveDataPGSchema() + "." + ANNOTATION_LIST_TABLE)) {
      try (CoStoSysConnection conn = dbc.obtainOrReserveConnection()){
        conn.setAutoCommit(true);
        Statement stmt = conn.createStatement();
        String sql = String.format("CREATE TABLE %s (%s text PRIMARY KEY)",
            dbc.getActiveDataPGSchema() + "." + ANNOTATION_LIST_TABLE, TABLE_NAME);
        stmt.execute(sql);
      } catch (SQLException e) {
        e.printStackTrace();
        SQLException ne = e.getNextException();
        if (null != ne)
          ne.printStackTrace();
      }
    }
  }
}
origin: de.julielab/jcore-xmi-db-writer

  effectiveTableName = dbDocumentTableName;
try {
  if (!dbc.tableExists(effectiveTableName)) {
    log.info("Creating table '{}' with schema '{}' (columns: {}).",
        effectiveTableName, schema, dbc.getFieldConfiguration(schema).getColumns());
origin: de.julielab/jcore-xmi-db-writer

  for (String annotation : annotationsToStore) {
    String annotationTableName = annotationTableManager.convertAnnotationTypeToTableName(annotation, storeAll);
    if (dbc.tableExists(annotationTableName))
      checkTableDefinition(annotationTableName, schemaAnnotation);
    serializedCASes.put(annotationTableName, new ArrayList<>());
if (dbc.tableExists(effectiveDocTableName))
  checkTableDefinition(effectiveDocTableName, schemaDocument);
de.julielab.xmlData.dataBaseDataBaseConnectortableExists

Popular methods of DataBaseConnector

  • <init>
  • checkTableDefinition
  • getActiveDataPGSchema
  • getFieldConfiguration
  • obtainOrReserveConnection
  • addXmiAnnotationFieldConfiguration
  • addXmiDocumentFieldConfiguration
  • addXmiTextFieldConfiguration
  • close
  • getActiveTableFieldConfiguration
  • getNextOrThisDataTable
  • getPrimaryKeyIndices
  • getNextOrThisDataTable,
  • getPrimaryKeyIndices,
  • isDataTable,
  • releaseConnections,
  • reserveConnection,
  • checkTableSchemaCompatibility,
  • countRowsOfDataTable,
  • countUnprocessed,
  • createSchema

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • BoxLayout (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now