/**export table data in DB2 database to MS Excel XP file |
*@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 targetExcelFile |
assign the destination file, in general, you want to export table data to a access file, But in fact, you can assign any legal jdbc url no the prefix part(jdbc:excel:/), so, c:/tmp/a.xls, c:/tmp/xx.zip/b.xls, ////192.168.10.2/sharedir/aa.xls, //domain.com:3099/c:/data/bb.xls all can assigned to this parameter, more about this information, please see the document. |
*@param targetSheetName |
assign the destination sheet name in the MS Excel file 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 exportTableToExcelXP(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export table data to MS Excel 2002 file*/ |
public static void exportTableToExcel2002(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export table data to MS Excel 2001 file */ |
public static void exportTableToExcel2000(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export table data to MS Excel 2000 file */ |
public static void exportTableToExcel2000(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export table data to MS Excel 2003 file */ |
public static void exportTableToExcel2003(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export table data to MS Excel 2004 file */ |
public static void exportTableToExcel2003(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export table data to MS Excel 95 file */ |
public static void exportTableToExcel95(String schemaName, String tableName, String targetExcelFile, String targetSheetName,String targetConnProps) |
|
/**export table data to MS Excel97 file */ |
public static void exportTableToExcel97(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export table data to MS Excel98 file */ |
public static void exportTableToExcel97(String schemaName, String tableName, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
|
/**export SQL query result to MS Excel XP file |
*@param querySQL |
assign the SQL to execute for export data |
*@param targetExcelFile |
assign the destination file, in general, you want to export SQL query result to a access file, so this parameter name is targetExcelFile, but in fact, you can assign any legal jdbc url no the prefix part(jdbc:excel:/), so, c:/tmp/a.xls, c:/tmp/xx.zip/b.xls, ////192.168.10.2/sharedir/aa.xls, //domain.com:3099/c:/data/bb.xls all can assigned to this parameter, more about this information, please see the document. |
*@param targetSheetName |
assign the destination sheet name in MS Excel file 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 exportTableToExcelXP(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export SQL query result to MS Excel 2002 file*/ |
public static void exportTableToExcel2002(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export SQL query result to MS Excel 2001 file */ |
public static void exportTableToExcel2000(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export SQL query result to MS Excel 2000 file */ |
public static void exportTableToExcel2000(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export SQL query result to MS Excel 2003 file */ |
public static void exportTableToExcel2003(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export SQL query result to MS Excel 2004 file */ |
public static void exportTableToExcel2003(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export SQL query result to MS Excel 95 file */ |
public static void exportTableToExcel95(String querySQL, String targetExcelFile, String targetSheetName,String targetConnProps) |
|
/**export SQL query result to MS Excel97 file */ |
public static void exportTableToExcel97(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
/**export SQL query result to MS Excel98 file */ |
public static void exportTableToExcel97(String querySQL, String targetExcelFile, String targetSheetName, String targetConnProps) |
|
|
com.hxtt.data.export.advance.ConnectionGetter.setConnection(yourConnection);
com.hxtt.data.export.advance.DB22Excel.exportTableToExcel2000(null,"ATABLE","c:/tmp/a.xls","BTABLE",null);
You just supply a DB2 database connection , and then call
the method. We will release this connection after complete a export operation
for we want to avoid holding a reference to the connection . So, if you want
continue execute other export operation, you should recall the setConnection
method, for example, the code follows export two table to the target.
com.hxtt.data.export.advance.ConnectionGetter.setConnection(yourConnection);
com.hxtt.data.export.advance.DB22Excel.exportQueryToExcel2000("select * from atable a, btable b where a.id=b.id","c:/tmp/a.xls","BTABLE",null); |