spring-boot-oracle spring-batch

來源:互聯網
上載者:User

標籤:ble   copy from   boot   org   write   password   pack   art   ring   

Install/Configure Oracle express
  1. Oracle xe installer for linux (I don‘t care if you‘re running linux or not, this guy is going in a VM): http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
  1. sqlplus /nolog
  2. connect sys as sysdba
Oracle JDBC Driver shenanigans
  1. Download the JDBC driver: http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
  2. Here‘s where things get interesting. Apparently gradle can‘t load this jar from a flatFile repository. So the workaround is to create a local maven repository and load this 1 jar into it.
  3. cd to the directory where the ojdbc jar is located
  4. mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.4 -Dpackaging=jar
  5. In the above command make sure to adjust the file, artifactId, and version to match the driver you downloaded.

https://github.com/shawn-mcginty/spring-boot-oracle-example

How to copy from CSV file to the database. 

https://github.com/wbotelhos/spring-batch-flat-file-database

通過 spring boot 啟動spring batch讀取csv檔案並使用hibernate將插入MySQL資料庫

 https://github.com/zyongjava/spring-batch

spring-batch-jpa

This is an example project that contains everything needed to use Spring Batch 3 to read from a database via JPA and write to a database via JPA. There are also tests.

There were two blog entries associated with this project.

BlogsSpring Batch – reading and writing JPA

This is a simple Spring Batch project. This implementation will read from a database table and write to a database table via JPA.

http://javaninja.net/2016/02/spring-batch-reading-and-writing-jpa/

Spring Batch JPA Testing with Transactions

This blog goes over all of the testing options I was able to discover for Spring Batch with JPA.

http://javaninja.net/2016/02/spring-batch-jpa-testing-with-transactions/

https://github.com/sheltonn/spring-batch-jpa

 

Spring Boot Spring Batch JPA PostGreSQL

org.springframework.batch.item.database.JpaItemWriter

    /**     * Nothing special here a simple JpaItemWriter     * @return     */    @Bean    public ItemWriter<Person> writer() {        JpaItemWriter writer = new JpaItemWriter<Person>();        writer.setEntityManagerFactory(entityManagerFactory().getObject());        return writer;    }

 

    /**     * As data source we use an external database     *     * @return     */    @Bean    public DataSource dataSource() {        DriverManagerDataSource dataSource = new DriverManagerDataSource();        dataSource.setDriverClassName(databaseDriver);        dataSource.setUrl(databaseUrl);        dataSource.setUsername(databaseUsername);        dataSource.setPassword(databasePassword);        return dataSource;    }    @Bean    public LocalContainerEntityManagerFactoryBean entityManagerFactory() {        LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();        lef.setPackagesToScan("com.iqmsoft.spring.batch");        lef.setDataSource(dataSource());        lef.setJpaVendorAdapter(jpaVendorAdapter());        lef.setJpaProperties(new Properties());        return lef;    }    @Bean    public JpaVendorAdapter jpaVendorAdapter() {        HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();        jpaVendorAdapter.setDatabase(Database.POSTGRESQL);        jpaVendorAdapter.setGenerateDdl(true);        jpaVendorAdapter.setShowSql(false);        jpaVendorAdapter.setDatabasePlatform("org.hibernate.dialect.PostgreSQLDialect");        return jpaVendorAdapter;    }

 



 https://github.com/Murugar/SpringBootBatchJPA

 

spring-boot-oracle spring-batch

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.