|
/**export dbf table data to DB2 database |
*@param sourceUrl |
assign the DBF file directory location, in general, you want to export table data from a DBF file. In fact, you can assign any legal jdbc url not contains the prefix part(jdbc:dbf:/), so, c:/tmp, c:/tmp/xx.zip, ////192.168.10.2/sharedir, //domain.com:3099/c:/data all can assigned to this parameter, more about this information, please see the document. |
*@param sourceTableName |
assign the source table name |
*@param targetSchemaName |
assign the destination schema, it null, export to the current user |
*@param targetTableName |
assign the destination table name which you want to exported to it |
*@param sourceConnPar |
assign the conntion properties, please split multi properties by ';' ,for example, username=abc;password=abc |
*/ |
|
public static void exportTable(String sourceUrl, String sourceTableName, String targetSchemaName, String targetTableName,String sourceConnPar) |
|
|
/**export SQL query result to DB2 database |
*@param sourceUrl |
assign the DBF file directory location, in general, you want to export table data from a DBF file.In fact, you can assign any legal jdbc url not contains the prefix part(jdbc:dbf:/), so, c:/tmp, c:/tmp/xx.zip, ////192.168.10.2/sharedir, //domain.com:3099/c:/data all can assigned to this parameter, more about this information, please see the document. |
*@param querySQL |
assign the query SQL |
*@param targetSchemaName |
assign the destination schema, it null, export to the current user |
*@param targetTableName |
assign the destination table name which you want to exported to it |
*@param sourceConnPar |
assign the conntion properties, please split multi properties by ';' ,for example, username=abc;password=abc |
*/ |
|
public static void exportQuery(String sourceUrl, String query, String targetSchemaName, String targetTableName, String sourceConnPar) |
|
|
com.hxtt.data.export.advance.ConnectionGetter.setConnection(yourConnection);
com.hxtt.data.export.advance.DBF2DB2.exportTable("c:/tmp","ATABLE",null,"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.DBF2DB2.exportQuery("c:/tmp","select * from atable a, btable b where a.id=b.id",null,"BTABLE",null); |
|