Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sap-service
Commits
df432dca
Commit
df432dca
authored
Jul 22, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
6f110527
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
18 deletions
+3
-18
DataSourceConfig.java
src/main/java/com/egolm/sso/config/DataSourceConfig.java
+0
-16
CommonService.java
src/main/java/com/egolm/sso/services/CommonService.java
+3
-2
No files found.
src/main/java/com/egolm/sso/config/DataSourceConfig.java
View file @
df432dca
...
@@ -2,7 +2,6 @@ package com.egolm.sso.config;
...
@@ -2,7 +2,6 @@ package com.egolm.sso.config;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -38,19 +37,4 @@ public class DataSourceConfig {
...
@@ -38,19 +37,4 @@ public class DataSourceConfig {
return
jdbcTemplate
;
return
jdbcTemplate
;
}
}
@Bean
@Qualifier
(
"dataSource2"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
public
DataSource
getDataSource2
()
{
return
DataSourceBuilder
.
create
().
type
(
DruidDataSource
.
class
).
build
();
}
@Bean
@Qualifier
(
"jdbcTemplate2"
)
public
JdbcTemplate
getJdbcTemplate2
(
@Qualifier
(
"dataSource2"
)
DataSource
dataSource
)
{
JdbcTemplate
jdbcTemplate
=
new
JdbcTemplate
();
jdbcTemplate
.
setDataSource
(
dataSource
);
return
jdbcTemplate
;
}
}
}
\ No newline at end of file
src/main/java/com/egolm/sso/services/CommonService.java
View file @
df432dca
...
@@ -4,10 +4,11 @@ import java.text.MessageFormat;
...
@@ -4,10 +4,11 @@ import java.text.MessageFormat;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.dao.EmptyResultDataAccessException
;
import
org.springframework.dao.EmptyResultDataAccessException
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.egolm.sso.config.XRException
;
import
com.egolm.sso.config.XRException
;
...
@@ -15,9 +16,9 @@ import com.egolm.sso.config.XRException;
...
@@ -15,9 +16,9 @@ import com.egolm.sso.config.XRException;
public
class
CommonService
{
public
class
CommonService
{
@Autowired
@Autowired
@Qualifier
(
"jdbcTemplate2"
)
private
JdbcTemplate
jdbcTemplate
;
private
JdbcTemplate
jdbcTemplate
;
@Transactional
(
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
Long
getNextval
(
String
sName
)
{
public
Long
getNextval
(
String
sName
)
{
try
{
try
{
Map
<
String
,
Object
>
seqMap
=
jdbcTemplate
.
queryForMap
(
"select * from x_sequence where name = ?"
,
sName
);
Map
<
String
,
Object
>
seqMap
=
jdbcTemplate
.
queryForMap
(
"select * from x_sequence where name = ?"
,
sName
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment