这里是tomcat报错信息
(环境:nutz1.53,jdk7,tomcat7)
十一月 18, 2015 9:26:47 上午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\apache-tomcat-7\webapps\ROOT has finished in 7,110 ms
十一月 18, 2015 9:26:47 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-88"]
十一月 18, 2015 9:26:47 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
十一月 18, 2015 9:26:47 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 7285 ms
2015-11-18 09:28:33,570 [INFO][org.nutz.dao.jdbc.Jdbcs] - Get Connection from DataSource for JdbcExpert
2015-11-18 09:28:33,820 [INFO][com.alibaba.druid.pool.DruidDataSource] - {dataSource-2} inited
2015-11-18 09:28:34,210 [ERROR][com.alibaba.druid.pool.DruidDataSource] - create connection error
java.sql.SQLException: ResultSet is from UPDATE. No Data.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7158)
at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3890)
at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3431)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2386)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1375)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1844)
2015-11-18 09:28:34,257 [ERROR][com.alibaba.druid.pool.DruidDataSource] - create connection error
java.sql.SQLException: ResultSet is from UPDATE. No Data.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7158)
at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3890)
at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3431)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2386)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1375)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431)
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1844)
这里是datasource.json数据库配置文件
var ioc = {
dataSource:{
type:"com.alibaba.druid.pool.DruidDataSource",
events:{
depose:"close"
},
fields:{
driverClassName:"com.microsoft.sqlserver.jdbc.SQLServerDriver",
url:"jdbc:sqlserver://192.168.0.239:1433;databaseName=xxx",
username:"sa",
password:"pass",
maxActive:20,
testWhileIdle:true,
validationQuery:'SELECT COUNT(*) FROM Banned_User_Table',
removeAbandoned:true ,
removeAbandonedTimeout:1800,
filters : "mergeStat",
connectionProperties : "druid.stat.slowSqlMillis=2000"
}
},
dao: {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:'dataSource'}]
},
dataSource2:{
type:"com.alibaba.druid.pool.DruidDataSource",
events:{
depose:"close"
},
fields:{
url:"jdbc:mysql://192.168.0.239:3306/xxxx?useUnicode=true",
username:"root",
password:"pass",
maxActive:20,
testWhileIdle:true,
validationQuery:'SELECT COUNT(*) FROM SYS_DBTEST',
removeAbandoned:true ,
removeAbandonedTimeout:1800
}
},
dao2 : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:'dataSource2'}]
}
}