shiro 使用 微软数据库(ms-sql) 的配置

在网上找了一下,没找到,然后尝试配置了下,可用。需要用到两个包:c3p0-0.9.1.2.jar和mssqljdbc4_2008.jar

[main]
ds = com.mchange.v2.c3p0.ComboPooledDataSource
ds.driverClass = com.microsoft.sqlserver.jdbc.SQLServerDriver
ds.user = 用户
ds.password = 密码
ds.jdbcUrl = jdbc:sqlserver://localhost:1433;DatabaseName=数据库
jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
jdbcRealm.permissionsLookupEnabled = true
jdbcRealm.authenticationQuery = SELECT password FROM 用户表 WHERE account = ?
jdbcRealm.userRolesQuery = SELECT role FROM 角色表 WHERE account = ?
jdbcRealm.permissionsQuery = SELECT permission FROM 权限表 WHERE account = ?
jdbcRealm.dataSource = $ds
authc.loginUrl = /login
perms.unauthorizedUrl = /login
roles.unauthorizedUrl = /login

[urls]
/login = anon
/chklogin = anon
/* = authc

你可能感兴趣的:(shiro,MSSQL,sqlserver,jFinal,微软数据库,ms-sql)