gpt4 book ai didi

java.sql.SQL警告: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to X

转载 作者:行者123 更新时间:2023-12-01 16:05:31 43 4
gpt4 key购买 nike

我使用的是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)

我的 hibernate 初始化日志是:

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

最佳答案

This说:

This is a normal message from the MS jdbc driver when the database that you are using for JM isn''t the default database for the sql server account you are using to access the database. Pretty much ignore it - it''s completely harmless.

关于java.sql.SQL警告: [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to X,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2718676/

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com