Chinaunix首页 | 论坛 | 博客
  • 博客访问: 104644813
  • 博文数量: 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博客
  • 博客访问: 104644814
  • 博文数量: 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博客
  • 博客访问: 104644815
  • 博文数量: 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博客
  • 博客访问: 104644816
  • 博文数量: 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博客
  • 博客访问: 104644817
  • 博文数量: 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博客
  • 博客访问: 104644818
  • 博文数量: 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博客
  • 博客访问: 104644819
  • 博文数量: 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博客
  • 博客访问: 104644820
  • 博文数量: 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博客
  • 博客访问: 104644821
  • 博文数量: 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博客
  • 博客访问: 104644822
  • 博文数量: 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博客
  • 博客访问: 104644823
  • 博文数量: 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博客
  • 博客访问: 104644814
  • 博文数量: 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博客
  • 博客访问: 104644825
  • 博文数量: 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博客
  • 博客访问: 104644826
  • 博文数量: 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博客
  • 博客访问: 104644827
  • 博文数量: 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博客
  • 博客访问: 104644828
  • 博文数量: 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博客
  • 博客访问: 104644829
  • 博文数量: 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博客
  • 博客访问: 104644830
  • 博文数量: 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博客
  • 博客访问: 104644831
  • 博文数量: 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博客
  • 博客访问: 104644832
  • 博文数量: 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博客
  • 博客访问: 104644833
  • 博文数量: 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博客
  • 博客访问: 104644834
  • 博文数量: 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博客
  • 博客访问: 104644835
  • 博文数量: 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博客
  • 博客访问: 104644836
  • 博文数量: 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博客
  • 博客访问: 104644837
  • 博文数量: 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博客
  • 博客访问: 104644838
  • 博文数量: 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博客
  • 博客访问: 104644829
  • 博文数量: 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博客
  • 博客访问: 104644840
  • 博文数量: 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博客
  • 博客访问: 104644841
  • 博文数量: 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博客
  • 博客访问: 104644842
  • 博文数量: 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博客
  • 博客访问: 104644843
  • 博文数量: 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博客
  • 博客访问: 104644844
  • 博文数量: 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博客
  • 博客访问: 104644845
  • 博文数量: 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博客
  • 博客访问: 104644846
  • 博文数量: 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博客
  • 博客访问: 104644847
  • 博文数量: 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博客
  • 博客访问: 104644848
  • 博文数量: 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博客
  • 博客访问: 104644849
  • 博文数量: 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博客
  • 博客访问: 104644850
  • 博文数量: 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博客
  • 博客访问: 104644851
  • 博文数量: 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博客
  • 博客访问: 104644852
  • 博文数量: 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博客
  • 博客访问: 104644853
  • 博文数量: 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博客
  • 博客访问: 104644844
  • 博文数量: 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博客
  • 博客访问: 104644855
  • 博文数量: 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博客
  • 博客访问: 104644856
  • 博文数量: 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博客
  • 博客访问: 104644857
  • 博文数量: 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博客
  • 博客访问: 104644858
  • 博文数量: 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博客
  • 博客访问: 104644859
  • 博文数量: 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博客
  • 博客访问: 104644860
  • 博文数量: 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博客
  • 博客访问: 104644861
  • 博文数量: 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博客
  • 博客访问: 104644862
  • 博文数量: 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博客
  • 博客访问: 104644863
  • 博文数量: 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博客
  • 博客访问: 104644864
  • 博文数量: 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 跟踪信息。

阅读(332791) | 评论(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 跟踪信息。

阅读(332790) | 评论(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 跟踪信息。

阅读(332789) | 评论(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 跟踪信息。

阅读(332788) | 评论(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 跟踪信息。

阅读(332787) | 评论(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 跟踪信息。

阅读(332786) | 评论(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 跟踪信息。

阅读(332785) | 评论(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 跟踪信息。

阅读(332784) | 评论(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 跟踪信息。

阅读(332783) | 评论(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 跟踪信息。

阅读(332782) | 评论(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 跟踪信息。

阅读(332781) | 评论(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 跟踪信息。

阅读(332780) | 评论(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 跟踪信息。

阅读(332779) | 评论(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 跟踪信息。

阅读(332778) | 评论(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 跟踪信息。

阅读(332777) | 评论(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 跟踪信息。

阅读(332776) | 评论(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 跟踪信息。

阅读(332775) | 评论(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 跟踪信息。

阅读(332774) | 评论(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 跟踪信息。

阅读(332773) | 评论(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 跟踪信息。

阅读(332772) | 评论(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 跟踪信息。

阅读(332771) | 评论(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 跟踪信息。

阅读(332770) | 评论(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 跟踪信息。

阅读(332769) | 评论(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 跟踪信息。

阅读(332768) | 评论(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 跟踪信息。

阅读(332767) | 评论(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 跟踪信息。

阅读(332766) | 评论(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 跟踪信息。

阅读(332765) | 评论(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 跟踪信息。

阅读(332764) | 评论(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 跟踪信息。

阅读(332763) | 评论(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 跟踪信息。

阅读(332762) | 评论(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 跟踪信息。

阅读(332761) | 评论(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 跟踪信息。

阅读(332760) | 评论(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 跟踪信息。

阅读(332759) | 评论(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 跟踪信息。

阅读(332758) | 评论(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 跟踪信息。

阅读(332757) | 评论(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 跟踪信息。

阅读(332756) | 评论(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 跟踪信息。

阅读(332755) | 评论(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 跟踪信息。

阅读(332754) | 评论(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 跟踪信息。

阅读(332753) | 评论(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 跟踪信息。

阅读(332752) | 评论(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 跟踪信息。

阅读(332751) | 评论(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 跟踪信息。

阅读(332750) | 评论(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 跟踪信息。

阅读(332749) | 评论(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 跟踪信息。

阅读(332748) | 评论(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 跟踪信息。

阅读(332747) | 评论(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 跟踪信息。

阅读(332746) | 评论(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 跟踪信息。

阅读(332745) | 评论(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 跟踪信息。

阅读(332744) | 评论(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 跟踪信息。

阅读(332743) | 评论(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 跟踪信息。

阅读(332742) | 评论(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 跟踪信息。

阅读(332741) | 评论(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 跟踪信息。

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