Package org.apache.flink.api.java.record.io.jdbc

Examples of org.apache.flink.api.java.record.io.jdbc.JDBCInputFormat


    jdbcInputFormat = null;
  }

  @Test(expected = IllegalArgumentException.class)
  public void testInvalidConnection() {
    jdbcInputFormat = new JDBCInputFormat("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:idontexist", "select * from books;");
    jdbcInputFormat.configure(null);
  }
View Full Code Here


    jdbcInputFormat.configure(null);
  }

  @Test(expected = IllegalArgumentException.class)
  public void testInvalidQuery() {
    jdbcInputFormat = new JDBCInputFormat("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:ebookshop", "abc");
    jdbcInputFormat.configure(null);
  }
View Full Code Here

    jdbcInputFormat.configure(null);
  }

  @Test(expected = IllegalArgumentException.class)
  public void testInvalidDBType() {
    jdbcInputFormat = new JDBCInputFormat("idontexist.Driver", "jdbc:derby:memory:ebookshop", "select * from books;");
    jdbcInputFormat.configure(null);
  }
View Full Code Here

    jdbcInputFormat.configure(null);
  }

  @Test(expected = IllegalArgumentException.class)
  public void testUnsupportedSQLType() {
    jdbcInputFormat = new JDBCInputFormat("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:ebookshop", "select * from bookscontent");
    jdbcInputFormat.configure(null);
    jdbcInputFormat.nextRecord(new Record());
  }
View Full Code Here

    jdbcInputFormat.nextRecord(new Record());
  }

  @Test(expected = IllegalArgumentException.class)
  public void testNotConfiguredFormatNext() {
    jdbcInputFormat = new JDBCInputFormat("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:ebookshop", "select * from books");
    jdbcInputFormat.nextRecord(new Record());
  }
View Full Code Here

    jdbcInputFormat.nextRecord(new Record());
  }

  @Test(expected = IllegalArgumentException.class)
  public void testNotConfiguredFormatEnd() {
    jdbcInputFormat = new JDBCInputFormat("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:ebookshop", "select * from books");
    jdbcInputFormat.reachedEnd();
  }
View Full Code Here

    jdbcInputFormat.reachedEnd();
  }

  @Test
  public void testJDBCInputFormat() throws IOException {
    jdbcInputFormat = new JDBCInputFormat("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:ebookshop", "select * from books");
    jdbcInputFormat.configure(null);
    Record record = new Record();
    int recordCount = 0;
    while (!jdbcInputFormat.reachedEnd()) {
      jdbcInputFormat.nextRecord(record);
View Full Code Here

     * In this example we use the constructor where the url contains all the settings that are needed.
     * You could also use the default constructor and deliver a Configuration with all the needed settings.
     * You also could set the settings to the source-instance.
     */
    GenericDataSource<JDBCInputFormat> source = new GenericDataSource<JDBCInputFormat>(
        new JDBCInputFormat(
            "org.apache.derby.jdbc.EmbeddedDriver",
            "jdbc:derby:memory:ebookshop",
            "select * from books"),
        "Data Source");

View Full Code Here

TOP

Related Classes of org.apache.flink.api.java.record.io.jdbc.JDBCInputFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.