Package org.h2.tools
Class CreateCluster
java.lang.Object
org.h2.util.Tool
org.h2.tools.CreateCluster
Creates a cluster from a stand-alone database.
Copies a database to another location if required.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates a cluster.static void
Options are case sensitive.private static void
performTransfer
(Statement statSource, String urlTarget, String user, String password, String serverList) private static void
void
Run the tool with the given output stream and arguments.private static Future
<?> startWriter
(PipedReader pipeReader, Statement statSource) Methods inherited from class org.h2.util.Tool
isOption, printNoDatabaseFilesFound, setOut, showUsage, showUsageAndThrowUnsupportedOption, throwUnsupportedOption
-
Constructor Details
-
CreateCluster
public CreateCluster()
-
-
Method Details
-
main
Options are case sensitive.Supported options [-help] or [-?] Print the list of options [-urlSource "<url>"] The database URL of the source database (jdbc:h2:...) [-urlTarget "<url>"] The database URL of the target database (jdbc:h2:...) [-user <user>] The user name (default: sa) [-password <pwd>] The password [-serverList <list>] The comma separated list of host names or IP addresses - Parameters:
args
- the command line arguments- Throws:
SQLException
- on failure
-
runTool
Description copied from class:Tool
Run the tool with the given output stream and arguments.- Specified by:
runTool
in classTool
- Parameters:
args
- the argument list- Throws:
SQLException
- on failure
-
execute
public void execute(String urlSource, String urlTarget, String user, String password, String serverList) throws SQLException Creates a cluster.- Parameters:
urlSource
- the database URL of the original databaseurlTarget
- the database URL of the copyuser
- the user namepassword
- the passwordserverList
- the server list- Throws:
SQLException
- on failure
-
process
private static void process(String urlSource, String urlTarget, String user, String password, String serverList) throws SQLException - Throws:
SQLException
-
performTransfer
private static void performTransfer(Statement statSource, String urlTarget, String user, String password, String serverList) throws SQLException - Throws:
SQLException
-
startWriter
private static Future<?> startWriter(PipedReader pipeReader, Statement statSource) throws IOException - Throws:
IOException
-