Commit c03f9101 authored by Quxl's avatar Quxl

Change-Id: I42b8e82c33a469906e8de55d5bb48dda46b4f5ce
parent 3dde0a92
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, "");
}
} }
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment