Chinaunix首页 | 论坛 | 博客
  • 博客访问: 106698824
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698835
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698836
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698837
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698838
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698839
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698840
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698841
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698842
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698843
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698844
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698845
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698846
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698847
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698848
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698839
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698850
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698851
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698852
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698853
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698854
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698855
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698856
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698857
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698858
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698859
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698860
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698861
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698862
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698863
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698854
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698865
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698866
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698867
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698868
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698869
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698870
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698871
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698872
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698873
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698874
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698875
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698876
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698877
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698878
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698869
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698880
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698881
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698882
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698883
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698884
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks

DB2 9 应用开发(733 考试)认证指南,第 6 部分: .NET 编程(5)-sdccf-ChinaUnix博客
  • 博客访问: 106698885
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类:

2008-05-31 23:37:00

实现 DB2 与 .NET 框架的无缝接口

developerWorks



故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336839) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336838) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336837) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336836) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336835) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336834) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336833) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336832) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336831) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336830) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336829) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336828) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336827) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336826) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336825) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336824) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336823) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336822) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336821) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336820) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336819) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336818) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336817) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336816) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336815) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336814) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336813) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336812) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336811) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336810) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336809) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336808) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336807) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336806) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336805) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336804) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336803) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336802) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336801) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336800) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336799) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336798) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336797) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336796) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336795) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336794) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336793) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336792) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336791) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336790) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336789) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~


故障检修

在本节中,您将学习如何使用 ADO.NET 应用程序的故障检修工具。 您将考察使用 Exception 对象和 DB2 .NET 跟踪及 DB2 跟踪实用程序进行基本的错误处理和报告。

如果在 ADO.NET 中执行正确的错误处理方法,在 ADO.NET 应用程序中,应该将逻辑包括在 try/catch 块中。当 ADO.NET 方法中出现错误时,将抛出 Exception 对象。因此, 对于包含数据库操作的每个 try 块,相应的 catch 块应该包含处理一个 Exception 对象的逻辑。

在清单 10 中的示例中,一个 SELECT 语句中的 WHERE 子句含有类型不兼容的操作数:STAFF 表的 JOB 列的数据类型是 VARCHAR,而不是 INTEGER



                    
try
{
  ...
  cmd.Transaction = trans; 
  cmd.CommandText = "SELECT ID, NAME FROM STAFF WHERE JOB = 99";
  reader = cmd.ExecuteReader();    
  ...
}
catch (Exception ex)
{
  Console.WriteLine(ex.Message);
}

try 块中出现一个异常时,catch 块将捕获该异常。

ex.Message 包含异常的内容。含不兼容操作数的 SELECT 语句会生成以下异常:

ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the 
operation "=" are not compatible.  SQLSTATE=42818





回页首


为了调试 DB2 ADO.NET 应用程序,可以使用 DB2 ADO.NET 跟踪实用程序。 要激活 ADO.NET 跟踪实用程序,可以设置以下环境变量:

SET DB2NMPTRACE=1

激活 ADO.NET 跟踪实用程序之后,每当运行一个 DB2 ADO.NET 应用程序,就会生成对 ADO.NET 调用的一个详细的跟踪。清单 11 展示了前面开发的 AccessSamplDb 应用程序生成的跟踪数据:



                    
| DB2Trace.TraceVersion fnc data 10: Version: 9.0.0.1
| DB2Trace.TraceVersion fnc data 11: Framework: 1.1.4322.2300
| DB2Interop.Init fnc entry
| | DB2Interop.Init fnc data 10: file:///c:/windows/assembly/gac/ibm.data.db2/9.0.0.1
__7c307b91aa13d208/ibm.data.db2.dll
| | DB2Interop.Init fnc data 19: 9.1.0.DEF.1
| | DB2Interop.Init fnc data 20: DB2COPY1
| | DB2Interop.Init fnc data 30: D:\IBM\SQLLIB\
| | DB2Interop.Init fnc data 50: D:\IBM\SQLLIB\\bin\db2app.dll
| | DB2Interop.Init fnc data 55: a
| | DB2Interop.Init fnc data 60: 15
| | DB2Interop.Init fnc data 97: SOFTWARE\IBM\DB2\InstalledCopies
| | DB2Interop.Init fnc data 98: DB2COPY1
| | DB2Interop.Init fnc data 99: 0
| DB2Interop.Init fnc exit2, rc = 0 - False, 15
db2trace False
| DB2ConnPool.GetDB2ConnPool fnc data 5: 0
| DB2ConnPool.GetDB2ConnPool fnc data 10: 1
| DB2ConnPool.GetDB2ConnPool fnc data 11: 55706604
| DB2ConnPool.GetDB2ConnPool fnc data 254: 1 1
DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0
DB2ConnPool.DB2ConnPool fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc entry
| DBCWrapper.DBCWrapper fnc entry
| DBCWrapper.DBCWrapper fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc entry1 - Database=SAMPLE
| | DB2Connection.State.get fnc entry
| | | DB2Connection.State.get api data 10: Closed
| | DB2Connection.State.get fnc exit, rc = 0
| | DB2ConnPool.ReplaceConnectionStringParms fnc entry
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 10: Database=SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 15: database, SAMPLE
| | | DB2ConnPool.ReplaceConnectionStringParms fnc data 20: dsn=SAMPLE;
| | DB2ConnPool.ReplaceConnectionStringParms fnc exit, rc = 0
| DB2Connection.ConnectionString.set fnc exit, rc = 0
DB2Connection.DB2Connection1 fnc exit, rc = 0
DB2Connection.Open fnc entry
| DB2Connection.State.get fnc entry
| | DB2Connection.State.get api data 10: Closed
| DB2Connection.State.get fnc exit, rc = 0
| DB2ConnPool.GetDB2ConnPool fnc entry
| | DB2ConnPool.GetDB2ConnPool fnc data 254: 1 2
| DB2ConnPool.GetDB2ConnPool fnc exit, rc = 0

当具有含不兼容操作数的 SELECT 语句的程序运行时, .NET 跟踪实用程序捕获到错误:



                    
DB2Command.ExecuteReader2 fnc exit, rc = 0
DB2ConnPool.CheckClose fnc entry
DB2Exception.Message.get fnc entry
| DB2ConnPool.CheckClose fnc data 10: 2/8/2007 4:14:39 PM
| | DB2Resource.DB2Resource fnc entry2 - db2nmp.xml, null
| | DB2ConnPoolWrapper.LockPool fnc entry
| | | DB2Resource.GetMsgPath fnc entry
| | | | DB2ConnPoolWrapper.LockPool fnc data 10: dsn=SAMPLE;
| | | | | DB2Resource.GetMsgPath fnc data 10: D:\IBM\SQLLIB\
| | | | DB2ConnPoolWrapper.LockPool fnc exit, rc = 0
| | | DB2Resource.GetMsgPath fnc exit1, rc = 0 - D:\IBM\SQLLIB\msg\en_US
| | | DB2ConnPool.CheckClose fnc data 20:    dsn=SAMPLE;, xa: False, conns: 1, free:
0
| | DB2Resource.DB2Resource fnc exit, rc = 0
| | DB2ConnPool.CheckClose fnc data 25: POOL [dsn=SAMPLE;] 1->NULL    pPool.pLastConn
 = 1
| | DB2Exception.Message.get fnc data 20: ERROR [42818] [IBM][DB2/NT] SQL0401N  The d
ata types of the operands for the operation "=" are not compatible.  SQLSTATE=42818

| | DB2ConnPool.CheckClose fnc data 30:       dbc: 1, xa: False, inuse: True, free on
 close: False, lifetime: -1, 0
| DB2Exception.Message.get fnc exit, rc = 0
| DB2ConnPoolWrapper.UnlockPool fnc entry
ERROR [42818] [IBM][DB2/NT] SQL0401N  The data types of the operands for the operatio
n "=" are not compatible.  SQLSTATE=42818

DB2 .NET Provider 使用 DB2 CLI 的一些组件。这对于 DB2 ADO.NET 应用程序确定问题有时会很有用,可以获得 CLI 和 DB2 跟踪信息。

阅读(336788) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~