Chinaunix首页 | 论坛 | 博客
  • 博客访问: 90878039
  • 博文数量: 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博客
  • 博客访问: 90878040
  • 博文数量: 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博客
  • 博客访问: 90878041
  • 博文数量: 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博客
  • 博客访问: 90878042
  • 博文数量: 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博客
  • 博客访问: 90878043
  • 博文数量: 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博客
  • 博客访问: 90878044
  • 博文数量: 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博客
  • 博客访问: 90878045
  • 博文数量: 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博客
  • 博客访问: 90878046
  • 博文数量: 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博客
  • 博客访问: 90878047
  • 博文数量: 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博客
  • 博客访问: 90878048
  • 博文数量: 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博客
  • 博客访问: 90878039
  • 博文数量: 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博客
  • 博客访问: 90878050
  • 博文数量: 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博客
  • 博客访问: 90878051
  • 博文数量: 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博客
  • 博客访问: 90878052
  • 博文数量: 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博客
  • 博客访问: 90878053
  • 博文数量: 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博客
  • 博客访问: 90878054
  • 博文数量: 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博客
  • 博客访问: 90878055
  • 博文数量: 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博客
  • 博客访问: 90878056
  • 博文数量: 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博客
  • 博客访问: 90878057
  • 博文数量: 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博客
  • 博客访问: 90878058
  • 博文数量: 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博客
  • 博客访问: 90878059
  • 博文数量: 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博客
  • 博客访问: 90878060
  • 博文数量: 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博客
  • 博客访问: 90878061
  • 博文数量: 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博客
  • 博客访问: 90878062
  • 博文数量: 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博客
  • 博客访问: 90878063
  • 博文数量: 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博客
  • 博客访问: 90878054
  • 博文数量: 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博客
  • 博客访问: 90878065
  • 博文数量: 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博客
  • 博客访问: 90878066
  • 博文数量: 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博客
  • 博客访问: 90878067
  • 博文数量: 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博客
  • 博客访问: 90878068
  • 博文数量: 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博客
  • 博客访问: 90878069
  • 博文数量: 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博客
  • 博客访问: 90878070
  • 博文数量: 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博客
  • 博客访问: 90878071
  • 博文数量: 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博客
  • 博客访问: 90878072
  • 博文数量: 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博客
  • 博客访问: 90878073
  • 博文数量: 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博客
  • 博客访问: 90878074
  • 博文数量: 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博客
  • 博客访问: 90878075
  • 博文数量: 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博客
  • 博客访问: 90878076
  • 博文数量: 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博客
  • 博客访问: 90878077
  • 博文数量: 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博客
  • 博客访问: 90878078
  • 博文数量: 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博客
  • 博客访问: 90878069
  • 博文数量: 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博客
  • 博客访问: 90878080
  • 博文数量: 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博客
  • 博客访问: 90878081
  • 博文数量: 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博客
  • 博客访问: 90878082
  • 博文数量: 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博客
  • 博客访问: 90878083
  • 博文数量: 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博客
  • 博客访问: 90878084
  • 博文数量: 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博客
  • 博客访问: 90878085
  • 博文数量: 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博客
  • 博客访问: 90878086
  • 博文数量: 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博客
  • 博客访问: 90878087
  • 博文数量: 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博客
  • 博客访问: 90878088
  • 博文数量: 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博客
  • 博客访问: 90878089
  • 博文数量: 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博客
  • 博客访问: 90878090
  • 博文数量: 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 跟踪信息。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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