设为首页 加入收藏

TOP

DB2数据库、事务控制语言、系统控制语言、函数、嵌入式SQL(SQLJ) (二)
2014-11-23 21:58:54 来源: 作者: 【 】 浏览:9
Tags:DB2 数据库 事务 控制 语言 系统 函数 嵌入式 SQL SQLJ
rom db2admin.employee where empno = :str1 };

System.out.println("Received results:");

while (true) {

#sql { FETCH :cursor2 INTO :str2 };

if (cursor2.endFetch()) break;

System.out.print (" empno= " + str1);

System.out.print (" firstname= " + str2);

System.out.print ("");

}

cursor2.close();

// rollback the update

System.out.println("Rollback the update...");

#sql { ROLLBACK work };

System.out.println("Rollback done.");

}

catch( Exception e )

{

e.printStackTrace();

}

}

}

注:本程序采用JDBCODBC桥的方式访问数据库,必须配置ODBC数据源。

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇性能比较工具runstats 下一篇DB2在线备份

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: