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.

Blogs

Spring 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

最新文章

  1. 005_kafka_Java_API
  2. MFC学习-第一课 MFC运行机制
  3. UI控件之ListView
  4. Difference between Satisfiable, Valid, Unsatisfiable &amp; Invalid
  5. bzoj2794
  6. Codeforces Round #337 (Div. 2) D. Vika and Segments (线段树+扫描线+离散化)
  7. 如何定位到div滚动条的最底端
  8. 【HDOJ】1262 寻找素数对
  9. 使用微软企业库5.0提供的unity配置解藕系统demo(源码)
  10. 具体解释VMware 9.0.1安装MAC OS X 10.8(历时近3日感想篇)
  11. label 不同颜色
  12. nodejs中exports与module.exports的区别详细介绍
  13. 007-chrome插件系列
  14. linux常用命令 awk命令
  15. JNDI学习总结——Tomcat下使用C3P0配置JNDI数据源
  16. 移动端1px问题
  17. 水题B
  18. ThinkPHP同时操作多个数据库
  19. 一、drupal 安装汉化
  20. shell如何传递变量到另一个脚本文件中

热门文章

  1. 队列链式存储 - 设计与实现 - API函数
  2. 【freeradius】使用radclient调试radius协议
  3. Android Studio Gradle 多渠道自动打包,动态修改HostUrl,签名apk,混淆配置详解
  4. JAVA线程与线程、进程与进程间通信
  5. spring boot + mybatis + druid配置实践
  6. sqlplus 登录数据库
  7. JavaScript,只有你想不到
  8. linux中安装程序及账户管理
  9. sublime使用技巧之集成VI
  10. 【转载】Session的生命周期