Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1261b96f

Přidáno uživatelem stepanekp před asi 2 roky(ů)

#10237 Přidání připojení ke druhé databázi - MS SQL s tabulkou Users. Vytvoření konfiguračních souborů pro obě databáze.

Zobrazit rozdíly:

pom.xml
140 140
			<scope>test</scope>
141 141
		</dependency>
142 142

  
143
		<dependency>
144
			<groupId>com.microsoft.sqlserver</groupId>
145
			<artifactId>mssql-jdbc</artifactId>
146
			<version>12.2.0.jre11</version>
147
		</dependency>
148

  
143 149
	</dependencies>
144 150

  
145 151
	<build>
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/AntiPatternDetectionAppApplication.java
2 2

  
3 3
import cz.zcu.fav.kiv.antipatterndetectionapp.spring.AppConfig;
4 4
import org.springframework.boot.SpringApplication;
5
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
5 6
import org.springframework.boot.autoconfigure.SpringBootApplication;
6 7
import org.springframework.context.annotation.Import;
7 8

  
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/spring/ApplicationProperties.java
11 11
    private Environment environment;
12 12

  
13 13
    public String getDataSourceUrl () {
14
        return environment.getProperty("spring.datasource.url");
14
        return environment.getProperty("spring.datasource.jdbc-url");
15 15
    }
16 16

  
17 17
    public String getDataSourceUsername() {
src/main/resources/application.properties
1
# jpa settings
1 2
spring.jpa.hibernate.ddl-auto=update
3
spring.jpa.show-sql=true
4
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServerDialect
2 5

  
3
# database connection URL address:
4
spring.datasource.url=jdbc:mysql://localhost:3306/spade
5

  
6
# database connection username:
6
# mysql database connection:
7
spring.datasource.jdbc-url=jdbc:mysql://localhost:3306/spade
7 8
spring.datasource.username=root
8

  
9
# database connection password:
10 9
spring.datasource.password=
10
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
11 11

  
12
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
12
# mssql database connection:
13
spring.second-datasource.jdbc-url=jdbc:sqlserver://localhost:1433;databaseName=authspade;encrypt=true;trustServerCertificate=true
14
spring.second-datasource.username=test
15
spring.second-datasource.password=
16
spring.second-datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
13 17

  
14
# admin account username:
18
# admin account username and password:
15 19
account.user.name=root
20
account.user.password=
16 21

  
17 22
DATA_PATH=data/
18 23

  
19
# admin account password:
20
account.user.password=
21

  
22 24
# custom error pages
23 25
server.error.whitelabel.enabled=false
24 26

  

Také k dispozici: Unified diff