|
/**export dbf table data to DB2 database |
*@param sourceUrl |
assign the MS Access file location, in fact, you can assign any legal jdbc url not contains the prefix part(jdbc:access:/), so, c:/tmp/a.mdb, c:/tmp/xx.zip/aa.mdb, ////192.168.10.2/sharedir/c.mdb, //domain.com:3099/c:/data/b.mdb 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 MS Access file location or a valid directory, in fact, you can assign any legal jdbc url not contains the prefix part(jdbc:access:/), so, c:/tmp/a.mdb, c:/tmp/xx.zip/aa.mdb, ////192.168.10.2/sharedir/c.mdb, //domain.com:3099/c:/data/b.mdb 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 schema |
*@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.Access2DB2.exportTable('c:/tmp/a.mdb','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.Access2DB2.exportQuery("c:/tmp","select * from aa.atable a, bb.btable b where a.id=b.id",null,"BTABLE",null); |
|