replace mysql with derby db (#546)

* non transient data access exception examples

* change to derby db

* change to in memory derby db
This commit is contained in:
lor6 2016-07-31 19:15:08 +03:00 committed by Grzegorz Piwowarek
parent 0c8ba0bb44
commit 135adf81b1
4 changed files with 33 additions and 3 deletions

View File

@ -135,6 +135,27 @@
<artifactId>el-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.12.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbynet</artifactId>
<version>10.12.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<version>10.12.1.1</version>
</dependency>
</dependencies>
<build>

View File

@ -20,7 +20,7 @@ import com.google.common.base.Preconditions;
@Configuration
@EnableTransactionManagement
@PropertySource({ "classpath:persistence-mysql.properties" })
@PropertySource({ "classpath:persistence-derby.properties" })
@ComponentScan({ "org.baeldung.persistence" })
public class Cause1NonTransientConfig {

View File

@ -20,7 +20,7 @@ import com.google.common.base.Preconditions;
@Configuration
@EnableTransactionManagement
@PropertySource({ "classpath:persistence-mysql.properties" })
@PropertySource({ "classpath:persistence-derby.properties" })
@ComponentScan({ "org.baeldung.persistence" })
public class Cause4NonTransientConfig {
@ -72,5 +72,4 @@ public class Cause4NonTransientConfig {
// hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true");
return hibernateProperties;
}
}

View File

@ -0,0 +1,10 @@
# jdbc.X
jdbc.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
jdbc.url=jdbc:derby:memory:spring_exceptions;create=true
jdbc.user=tutorialuser
jdbc.pass=tutorialpass
# hibernate.X
hibernate.dialect=org.hibernate.dialect.DerbyDialect
hibernate.show_sql=false
hibernate.hbm2ddl.auto=create