FAQ for DB22Access Packages
The most recent version of this document can be viewed at here.
Table of Contents
1. General Questions
2. EMBED Package Questions
 
General Questions
 
1. How to know the detailed version information of DB22Access package?
check that MANIFEST.MF file in jar file. 
 
2. Can I use it in an iSeries OS/400 IBM machine that has Java 1.4 running in it?
The DB22Access packages can run on any platform with Java VM, which includes Microsoft Windows, Novell Netware, OS2, UNIX, and LINUX. It supports Personal Java, JDK1.0.X, JDK1.1.X, JDK1.2.X, JDK1.3.X, JDK1.4.X and JDK1.5.X. It supports JDBC1.2, JDBC2.0, and JDBC3.0 now.
 
3. What is difference between the DB22Access Package, Embedded(WithDrv) Package, Embedded(WithoutDrv) Package
The DB22Access Package is a GUI application , and the Embedded package is a package which can load into DB2 database(DB2 8 or upper). If you're exporting data by GUI application or a configuration file, you should use the DB22Access Package . If you want to export data more quickly and more flexibly, you can use the DB22Access Embedded Package.
As the tips by the name, Embedded(WithDrv) Package contains the HXTT Access JDBC package, and Embedded(WithoutDrv) Package doesn't.
 
4. What's the difference between the professional DB22Access Package and the enterprise DB22Access Package?
The standard DB22Access Package can export table data to MS Access from DB2.
The enterprise DB22Access Package contains the function of standard DB22Access Package, besides, it can export data accord view or a dynamic query, and execute export operation from a configuration file saved by prior export operation, and loaded into DB2 database(DB2 8 or upper) for build a procedure to export data.
 
5. What causes the 'No suitable driver' SQLException?
This error usually occurs during a call to DriverManager.getConnection(). The cause can be failing to load the appropriate JDBC driver before calling getConnection(), or specifying an invalid JDBC URL that isn't recognized by your JDBC driver. If you are exporting data by GUI application or a configuration file, you should check the DB2 JDBC package exists in the directory in your driver config, and check your JDBC url. If you are using Embedded(WithoutDrv) Package to export data in DB2 database, this error happens is because you haven't load the HXTT Access JDBC package in DB2 database.
 
6. What's the diffirence between the HXTT Access JDBC package contained in DataExp 2007 program and the standard HXTT Access JDBC package?
The HXTT Access JDBC package contained in DataExp 2007 program can only used in DataExp 2007 program and have some functional limit, so you cann't use it for other usage.
There are no other difference between the two package. They can accept the same jdbc url, and connect properties, and operate data, etc. 
 
7. Can export a table data to a non-exists table?
Yes. This package will auto create the destination table. In the GUI application, you can change the table structure when need creating the table.
 
8. I would like to export data from our application, instead of load it in DB2 database or GUI application. can  can do so?
Yeah. You can do so if you buy the Enterprise DB22Access product . Maybe you should pay the attention to the licence.

There is a class named com.hxtt.data.export.advance.DB22Access in the Embedded(WithDrv) Package and Embedded(WithoutDrv) Package contains a series method to export data. 
All methods will throws java.sql.SQLException.
/**export table data in DB2 database to MS Access XP database
 *@param schemaName assign the source data table's schema, null means that table is owned by current user
 *@param tableName assign the source table name
 *@param targetDatabase assign the destination database, in general, you want to export table data to a access database. In fact, you can assign any legal jdbc url no the prefix part(jdbc:access:/), so, c:/tmp/a.mdb,  c:/tmp/xx.zip/b.mdb, ////192.168.10.2/sharedir/aa.mdb, //domain.com:3099/c:/data/bb.mdb all can assigned to this parameter,  more about this information, please see the document
 *@param targetTableName     assign the destination table name which you want to exported to it
 *@param targetConnProps  assign the conntion properties, please split multi properties by ';' ,for example, username=abc;password=abc
 */
 public static void exportTableToAccessXP(String schemaName, String tableName, String targetDatabase, String targetTableName, String targetConnProps)
 
 /**export table data to MS Access 2002 database*/
 public static void exportTableToAccess2002(String schemaName, String tableName, String targetDatabase, String targetTableName, String targetConnProps) 
 
 /**export table data to MS Access 2000 database  */
 public static void exportTableToAccess2000(String schemaName, String tableName, String targetDatabase, String targetTableName, String targetConnProps)
 
 /**export table data to MS Access 2003 database  */
 public static void exportTableToAccess2003(String schemaName, String tableName, String targetDatabase, String targetTableName, String targetConnProps)
 
 /**export table data to MS Access 95 database   */
 public static void exportTableToAccess95(String schemaName, String tableName, String targetDatabase, String targetTableName,String targetConnProps)
 
 /**export table data to exportTableToAccess97 database   */
 public static void exportTableToAccess97(String schemaName, String tableName, String targetDatabase, String targetTableName, String targetConnProps)
 
 
/**export SQL query result data to MS Access XP database
 *@param query assign the SQL query
 *@param targetDatabase assign the destination database, in general, you want to export table data to a access database, so this parameter name is  targetDatabase, but in fact, you can assign any legal jdbc url no the prefix part(jdbc:access:/), so, c:/tmp/a.mdb,  c:/tmp/xx.zip/b.mdb, ////192.168.10.2/sharedir/aa.mdb, //domain.com:3099/c:/data/bb.mdb all can assigned to this parameter,  more about this information, please see the document
 *@param targetTableName     assign the destination table name which you want to exported to it
 *@param targetConnProps assign the conntion properties, please split multi properties by ';' ,for example, username=abc;password=abc
 */
 public static void exportQueryToAccessXP(String query, String targetDirectory, String targetTableName, String targetConnProps)
 
 /**export SQL query result data to MS Access 2002 database*/
 public static void exportQueryToAccess2002(String query, String targetDatabase, String targetTableName, String targetConnProps) 
 
 /**export SQL query result data to MS Access 2000 database  */
 public static void exportQueryToAccess2000(String query, String targetDatabase, String targetTableName, String targetConnProps)
 
 /**export SQL query result data to MS Access 2003 database  */
 public static void exportQueryToAccess2003(String query, String targetDatabase, String targetTableName, String targetConnProps)
 
 /**export SQL query result data to MS Access 95 database   */
 public static void exportQueryToAccess95(String query, String targetDatabase, String targetTableName,String targetConnProps)
 
 /**export SQL query result data to exportTableToAccess97 database   */
 public static void exportQueryToAccess97(String query, String targetDatabase, String targetTableName, String targetConnProps)
 
 
com.hxtt.data.export.advance.ConnectionGetter.setConnection(yourConnection);
com.hxtt.data.export.advance.DB22Access.exportTableToAccess2000(null,"ATABLE","c:/tmp/a.mdb","BTABLE",null);


Attention, affter exported one table, you must reset the connection to export another table for we will release the connection after complete a export operation.

com.hxtt.data.export.advance.ConnectionGetter.setConnection(yourConnection);
com.hxtt.data.export.advance.DB22Access.exportQueryToAccessXP("select * from ATABLE A,BTABLE B WHERE A.ID=B.ID","c:/tmp/a.mdb","BTABLE",null);
 
 
Embed Package Questions
 
1. What's the Embed Package?
Embed Package is a jar file which can load into DB2 database and execute export operation by DB2 procedure, or can used in your java program to execute export operation.
The Embedded(WithDrv) Package contains the HXTT Access JDBC package, and Embedded(WithoutDrv) Package doesn't.
If you have bought the the HXTT Access JDBC package, you can use the Embedded(WithoutDrv) Package to execute export operation. or else, you should the Embedded(WithDrv) Package to execute export operation.
 
2. How do I load the Embed Package(With HXTT Access JDBC Driver) into DB2 Database and execute export operation in DB2 database?
You can do as follows.
In DB2 Command Editor, run the follows command to load the embed package into DB2 database.
call sqlj.install_jar('file:c:/EMBDB22Access_WithDRV.jar','DB22Access')

Then, you should create the follows procedure,
create procedure exportTableToAccess2002(
in schemaname varchar(200),
in tablename varchar(200),
in targetdirectory varchar(200),
in targettablename varchar(200),
in targetconnpar varchar(200))
external name 'DB22ACCESS:com.hxtt.data.export.advance.DB22Access.exportTableToAccess2002'
language java parameter style java


Then, you can use the procedure exportTableToAccess2002 to export table/view date to DBase4 table.
 
  3. How do I load the Embed Package(Without HXTT Access JDBC Driver) into DB2 Database and execute export operation in DB2 database?
  It's same as install the Embed Package(With HXTT Access JDBC Driver) into DB2 database.
But you should install the HXTT Access JDBC Driver at the same time.

In DB2 Command Editor, run the follows command to  install the embed package into DB2 database.
call sqlj.install_jar('file:c:/Access_JDBC20.jar;c:/ EMBDB22Access_WithDRV.jar','DB22Access')
 
  4. When I install package to DB2 database, errors happen.
 

Please see http://www.ibm.com/developerworks/db2/library/techarticle/dm-0510law/. This page shows a lot of errors and give a answer.

 
  5. I loaded the package, created the procedure, but when executing procedure exportTableToAccess2002, errors happened.
 

Maybe you should restart the database server.  I don't know why but when i restart the database server, it works well.

 
  6. I loaded the package, created the procedure, grant privilege, and execute procedure exportTableToAccess2002 successly in machine, but I cann't find the data file in my machine
 

The data file will be located the DB2 Database Server machine.
For example, you execute the follows procedure,

BEGIN
  exportTableToAccess2002(null,'atable','c:/tmp/aa.mdb',null,null);
END;


This data of atable will export to the c:/tmp/atable located in the DB2 Databae Server machine no matter where you execute this procedure .

 
  7. How to export data accord a SQL query?
  For example,

BEGIN
  exportQueryToAccess2002('select * from aa.atable a,bb.btable b where a.id=b.id','c:/aa.mdb','XTABLE',null);
END;

 
  8. Can I load two package to DB2(8i or upper) database, for example, EMBDB22DBF_WithDrv.jar and EMBDBF2DB2_WithDrv.jar?

You can do so. But you should assign the different name when install this package..

 

Copyright © 2006 Hongxin Technology & Trade Ltd. | All Rights Reserved. |