Oracle神谕

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  284 随笔 :: 9 文章 :: 106 评论 :: 0 Trackbacks

我们使用jtds的SQL Server的驱动替代原来的SQL Server的驱动。后来出现在log中输出了这样的信息:
2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - SQL Warning: 5701, SQLState: 01000
2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - 已将数据库上下文改为 'logistics'。
2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - SQL Warning: 5703, SQLState: 01000
2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - 已将语言设置改为 简体中文。
经过使用Debug级别的log输出,发现是在
SQLDiagnostic.java
 /**
     * Create a dianostic SQLException or SQLWarning.
     *
     * @param number SQL Server error number.
     * @param state SQL Server state code.
     * @param serverity SQL Server serverity > 10 = error.
     * @param message SQL Server error message text.
     * @param server SQL Server name.
     * @param procName SQL Server stored procedure name.
     * @param line SQL Server error line number in SQL source.
     */
    void addDiagnostic(int number,
                       int state,
                       int serverity,
                       String message,
                       String server,
                       String procName,
                       int line)
这里捕获了 SQL Server error number的,
后经过MSDN找到如下资料:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_reslsyserr_2_9dtd.asp

Error 5701

Severity Level 10
Message Text

Changed database context to '%.*ls'.

Explanation

This is an informational message indicating that the database context has changed. This message is returned anytime a USE database statement is executed.

Action

None needed.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbcsql/od_6_010_34oj.asp

5701

Indicates that SQL Server put the user's context into the default database defined in the data source, or into the default database defined for the login ID used in the connection if the data source did not have a default database.

5703

Indicates the language being used on the server.

posted on 2005-06-30 10:06 java世界畅谈 阅读(956) 评论(1)  编辑  收藏 所属分类: JDBC Driver

评论

# re: 对JTDS的SQLWarning 的抛出的分析 2007-06-13 15:10 wang
用JSQL Driver  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: