Install/configure Oracle Express
- Oracle XE installer for Linux (I-don ' t care if you ' re running Linux or isn't, this guy is going in a VM): Http://www.oracle. Com/technetwork/database/database-technologies/express-edition/downloads/index.html
sqlplus /nolog
connect sys as sysdba
Oracle JDBC Driver Shenanigans
- Download the JDBC driver:http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html
- Here's where things get interesting. Apparently
gradle
can ' t load this jar from a flatFile
repository. So the workaround are to create a local MAVEN repository and load this 1 jar into it.
cd
To the directory where the Ojdbc jar is located
mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.4 -Dpackaging=jar
- 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
Start spring batch with spring boot to read the CSV file and use Hibernate to insert the MySQL database
Https://github.com/zyongjava/spring-batch
Spring-batch-jpa
This is an example project, contains everything needed to use Spring Batch 3 to read from a database via JPA and write To a database via JPA. There is also tests.
There were the entries associated with the This project.
Blogsspring Batch–reading and Writing JPA
This was a simple Spring Batch project. This implementation would 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 the testing options I is 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 () { new Jpaitemwriter<person >(); Writer.setentitymanagerfactory (Entitymanagerfactory (). GetObject ()); return writer; }
/*** As data source we use an external database * *@return */@Bean PublicDataSource DataSource () {Drivermanagerdatasource DataSource=NewDrivermanagerdatasource (); Datasource.setdriverclassname (Databasedriver); Datasource.seturl (Databaseurl); Datasource.setusername (DatabaseUserName); Datasource.setpassword (DatabasePassWord); returnDataSource; } @Bean PublicLocalcontainerentitymanagerfactorybean entitymanagerfactory () {Localcontainerentitymanagerfactorybean lef =NewLocalcontainerentitymanagerfactorybean (); Lef.setpackagestoscan ("Com.iqmsoft.spring.batch"); Lef.setdatasource (DataSource ()); Lef.setjpavendoradapter (Jpavendoradapter ()); Lef.setjpaproperties (NewProperties ()); returnLef; } @Bean PublicJpavendoradapter Jpavendoradapter () {hibernatejpavendoradapter jpavendoradapter=NewHibernatejpavendoradapter (); Jpavendoradapter.setdatabase (Database.postgresql); JPAVENDORADAPTER.SETGENERATEDDL (true); Jpavendoradapter.setshowsql (false); Jpavendoradapter.setdatabaseplatform ("Org.hibernate.dialect.PostgreSQLDialect"); returnJpavendoradapter; }
Https://github.com/Murugar/SpringBootBatchJPA
Spring-boot-oracle Spring-batch