|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.util.DatabaseTransferManager
public class DatabaseTransferManager
Transfer data between two JDBC databases
Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from formaria.
$Revision: 1.6 $
| Field Summary | |
|---|---|
protected boolean |
dropTables
|
protected java.util.prefs.Preferences |
prefs
|
protected java.sql.Connection |
sourceConn
|
protected java.lang.String |
sourceConnectionString
|
protected java.lang.String |
sourceDriverName
|
protected java.lang.String |
sourcePassword
|
protected java.lang.String |
sourceUserName
|
protected java.sql.Connection |
targetConn
|
protected java.lang.String |
targetConnectionString
|
protected java.lang.String |
targetDriverName
|
protected java.lang.String |
targetPassword
|
protected java.lang.String |
targetUserName
|
| Constructor Summary | |
|---|---|
DatabaseTransferManager()
Creates a new instance of TransferManager |
|
| Method Summary | |
|---|---|
void |
clearTable(java.lang.String tableName)
Empty the table of existing data |
void |
closeConnections()
Setup a connection to the target or sink database |
void |
copyTableData(java.lang.String tableName)
Copy the table's data |
void |
copyTables()
Copy tables between the source and sink |
void |
createTable(java.lang.String tableName)
Create a table in the target database |
void |
doTransfer()
|
void |
dropTable(java.lang.String tableName)
Drop the target table if it exists |
java.sql.Connection |
getConnection(java.lang.String driver,
java.lang.String urlStr,
java.lang.String userName,
java.lang.String password)
Gets a database connection |
boolean |
getConnectionParameters(boolean isSource)
Ask the user for the connection parameters |
static void |
main(java.lang.String[] args)
|
void |
setupDataSource()
Setup a connection to the source database |
void |
setupDataTarget()
Setup a connection to the target or sink database |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String sourceDriverName
protected java.lang.String sourceConnectionString
protected java.lang.String sourceUserName
protected java.lang.String sourcePassword
protected java.lang.String targetDriverName
protected java.lang.String targetConnectionString
protected java.lang.String targetUserName
protected java.lang.String targetPassword
protected java.sql.Connection sourceConn
protected java.sql.Connection targetConn
protected boolean dropTables
protected java.util.prefs.Preferences prefs
| Constructor Detail |
|---|
public DatabaseTransferManager()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public void doTransfer()
public void setupDataSource()
public void setupDataTarget()
public void closeConnections()
public void copyTables()
public void dropTable(java.lang.String tableName)
tableName - the name of the table to delete/droppublic void clearTable(java.lang.String tableName)
tableName - the name of the table to delete/droppublic void createTable(java.lang.String tableName)
tableName - the name of the table to delete/droppublic void copyTableData(java.lang.String tableName)
tableName - the name of the tablepublic boolean getConnectionParameters(boolean isSource)
isSource - true if the source parameters are being queried
public java.sql.Connection getConnection(java.lang.String driver,
java.lang.String urlStr,
java.lang.String userName,
java.lang.String password)
driver - the jdbc driver class nameurlStr - the url of the databaseuserName - the user name to use in making the connectionspassword - the connection password
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||