Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
admin
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
曲欣亮
admin
Commits
c03f9101
Commit
c03f9101
authored
Aug 06, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change-Id: I42b8e82c33a469906e8de55d5bb48dda46b4f5ce
parent
3dde0a92
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
LinkController.java
src/main/java/com/egolm/admin/controller/LinkController.java
+21
-1
application-dev.properties
src/main/resources/application-dev.properties
+1
-0
No files found.
src/main/java/com/egolm/admin/controller/LinkController.java
View file @
c03f9101
package
com
.
egolm
.
admin
.
controller
;
package
com
.
egolm
.
admin
.
controller
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.egolm.admin.pojo.TSystemCtrl
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -28,4 +35,17 @@ public class LinkController {
...
@@ -28,4 +35,17 @@ public class LinkController {
return
"1111"
;
return
"1111"
;
}
}
@Autowired
@Qualifier
(
"shopJdbcTemplate"
)
private
JdbcTemplate
jdbcTemplate
;
@ResponseBody
@ApiOperation
(
"测试SQLSERVER数据库连接"
)
@RequestMapping
(
value
=
"/testSqlserverConnect"
,
method
=
RequestMethod
.
POST
)
public
Object
testSqlserverConnect
()
{
String
sql
=
"select * from tSystemCtrl where sCode in ? and nTag&1=0"
;
return
jdbcTemplate
.
queryForList
(
sql
,
TSystemCtrl
.
class
,
""
);
}
}
}
src/main/resources/application-dev.properties
View file @
c03f9101
...
@@ -26,5 +26,6 @@ spring.datasource.shop.password=qiyang@2013
...
@@ -26,5 +26,6 @@ spring.datasource.shop.password=qiyang@2013
spring.datasource.shop.url
=
jdbc:sqlserver://10.10.0.22:1433;instanceName=SQLSERVER;DatabaseName=EGOLMDEV
spring.datasource.shop.url
=
jdbc:sqlserver://10.10.0.22:1433;instanceName=SQLSERVER;DatabaseName=EGOLMDEV
spring.datasource.shop.driver-class-name
=
com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.shop.driver-class-name
=
com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.shop.testWhileIdle
=
true
spring.datasource.shop.testWhileIdle
=
true
spring.datasource.shop.validationQueryTimeout
=
5
spring.datasource.shop.validationQuery
=
SELECT 1
spring.datasource.shop.validationQuery
=
SELECT 1
spring.datasource.shop.timeBetweenEvictionRunsMillis
=
3600000
spring.datasource.shop.timeBetweenEvictionRunsMillis
=
3600000
\ No newline at end of file
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