跨多个数据源的J2EE开发: 细节探讨 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-17
aqora.demo.orders; CREATE NICKNAME ora_lineitem FOR jaqora.demo.lineitem; CREATE NICKNAME ora_nation FOR jaqora.demo.nation; -- adjust data type to match other dbms ALTER NICKNAME ora_part altER COLUMN p_partkey LOCAL TYPE integer; ALTER NICKNAME ora_part altER COLUMN p_size LOCAL TYPE integer; ALTER NICKNAME ora_partsupp altER COLUMN ps_partkey LOCAL TYPE integer; ALTER NICKNAME ora_partsupp altER COLUMN ps_suppkey LOCAL TYPE integer; ALTER NICKNAME ora_partsupp altER COLUMN ps_availqty LOCAL TYPE integer; ALTER NICKNAME ora_supplier altER COLUMN s_suppkey LOCAL TYPE integer; ALTER NICKNAME ora_supplier altER COLUMN s_nationkey LOCAL TYPE integer; ALTER NICKNAME ora_nation altER COLUMN n_nationkey LOCAL TYPE integer; ALTER NICKNAME ora_nation altER COLUMN n_regionkey LOCAL TYPE integer; ALTER NICKNAME ora_orders altER COLUMN o_orderdate LOCAL TYPE date; ALTER NICKNAME ora_orders altER COLUMN o_custkey LOCAL TYPE integer; ALTER NICKNAME ora_orders altER COLUMN o_orderkey LOCAL TYPE integer; ALTER NICKNAME ora_orders altER COLUMN o_shippriority LOCAL TYPE integer; ALTER NICKNAME ora_customer altER COLUMN c_custkey LOCAL TYPE integer; ALTER NICKNAME ora_customer altER COLUMN c_nationkey LOCAL TYPE integer; ---------------------------------------------------- -- 2.3. ODBC local data source (Excel) ---------------------------------------------------- -- create ODBC wrapper DROP WRAPPER odbc; CREATE WRAPPER odbc LIBRARY ''db2rcodbc.dll''; -- create ODBC server CREATE SERVER jaqodbc TYPE odbc VERSION 3.0 WRAPPER odbc OPTIONS (NODE ''ExcelDB2'', DB2_NULL_VARIANT ''Y'', DB2_VARIANT ''Y'', PUSHDOWN ''Y''); -- create nicknames CREATE NICKNAME odbc_part FOR jaqodbc.part$; CREATE NICKNAME odbc_supplier FOR jaqodbc.supplier$; CREATE NICKNAME odbc_orders FOR jaqodbc.orders$; CREATE NICKNAME odbc_partsupp FOR jaqodbc.partsupp$; CREATE NICKNAME odbc_customer FOR jaqodbc.customer$; CREATE NICKNAME odbc_nation FOR jaqodbc.nation$; -- adjust nicknames to correct types ALTER NICKNAME odbc_part altER COLUMN p_partkey LOCAL TYPE integer; ALTER NICKNAME odbc_part altER COLUMN p_name LOCAL TYPE varchar(55); ALTER NICKNAME odbc_part altER COLUMN p_mfgr LOCAL TYPE char(25); ALTER NICKNAME odbc_part altER COLUMN p_brand LOCAL TYPE char(10); ALTER NICKNAME odbc_part altER COLUMN p_type LOCAL TYPE varchar(25); ALTER NICKNAME odbc_part altER COLUMN p_size LOCAL TYPE integer; ALTER NICKNAME odbc_part altER COLUMN p_container LOCAL TYPE char(10); ALTER NICKNAME odbc_part altER COLUMN p_retailprice LOCAL TYPE decimal(10,4); ALTER NICKNAME odbc_part altER COLUMN p_comment LOCAL TYPE varchar(23); -- ALTER NICKNAME odbc_customer altER COLUMN c_custkey LOCAL TYPE integer; ALTER NICKNAME odbc_customer altER COLUMN c_name LOCAL TYPE char(25); ALTER NICKNAME odbc_customer altER COLUMN c_address LOCAL TYPE varchar(40); ALTER NICKNAME odbc_customer a |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于跨多个数据源的J2EE开发: 细节探讨 - 编程入门网的所有评论