【问题标题】:java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to Xjava.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]数据库更改为 X
【发布时间】:2010-04-27 04:13:25
【问题描述】:

我正在使用 Hibernate 3.2.1 和数据库 SQLServer2000

当我尝试使用我的 dao 插入一些数据时,出现了一些警告,如下所示:

java.sql.SQLWarning: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to BTN_SPP_DB
    at com.microsoft.jdbc.base.BaseWarnings.createSQLWarning(Unknown Source)
    at com.microsoft.jdbc.base.BaseWarnings.get(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.getWarnings(Unknown Source)
    at org.hibernate.util.JDBCExceptionReporter.logAndClearWarnings(JDBCExceptionReporter.java:22)
    at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:443)
    at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:400)
    at org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:287)
    at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:221)
    at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:119)
    at co.id.hanoman.btnmw.spp.dao.TagihanDao.save(TagihanDao.java:43)
    at co.id.hanoman.btnmw.spp.dao.TagihanDao.save(TagihanDao.java:1)
    at co.id.hanoman.btnmw.spp.dao.test.TagihanDaoTest.testSave(TagihanDaoTest.java:81)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
    at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
    at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
    at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
    at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
    at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
    at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
    at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
    at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
    at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

我的休眠初始化日志是:

2010-04-26 22:54:05,203 INFO   [Version] Hibernate Annotations 3.3.0.GA 
2010-04-26 22:54:05,234 INFO   [Environment] Hibernate 3.2.1 
2010-04-26 22:54:05,234 INFO   [Environment] hibernate.properties not found 
2010-04-26 22:54:05,234 INFO   [Environment] Bytecode provider name : cglib 
2010-04-26 22:54:05,234 INFO   [Environment] using JDK 1.4 java.sql.Timestamp handling 
2010-04-26 22:54:05,343 INFO   [Configuration] configuring from resource: /hibernate.cfg.xml 
2010-04-26 22:54:05,343 INFO   [Configuration] Configuration resource: /hibernate.cfg.xml 
2010-04-26 22:54:05,406 DEBUG  [DTDEntityResolver] trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] 
2010-04-26 22:54:05,406 DEBUG  [DTDEntityResolver] recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/ 
2010-04-26 22:54:05,406 DEBUG  [DTDEntityResolver] located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath 
2010-04-26 22:54:05,453 DEBUG  [Configuration] hibernate.dialect=org.hibernate.dialect.SQLServerDialect 
2010-04-26 22:54:05,453 DEBUG  [Configuration] hibernate.connection.driver_class=com.microsoft.jdbc.sqlserver.SQLServerDriver 
2010-04-26 22:54:05,453 DEBUG  [Configuration] hibernate.connection.url=jdbc:microsoft:sqlserver://12.56.11.65:1433;databaseName=BTN_SPP_DB 
2010-04-26 22:54:05,453 DEBUG  [Configuration] hibernate.connection.username=spp 
2010-04-26 22:54:05,453 DEBUG  [Configuration] hibernate.connection.password=spp

【问题讨论】:

    标签: java sql-server jdbc


    【解决方案1】:

    This 说:

    当您用于 JM 的数据库不是您用于访问数据库的 sql server 帐户的默认数据库时,这是来自 MS jdbc 驱动程序的正常消息。几乎可以忽略它——它完全无害。

    【讨论】:

      猜你喜欢
      • 2019-11-09
      • 1970-01-01
      • 2018-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-02
      相关资源
      最近更新 更多