Top Description Fields Constructors Methods
org.h2.tools

public Class CreateCluster

extends Tool
Class Inheritance
Imports
java.io.IOException, .PipedReader, .PipedWriter, java.sql.ResultSet, .SQLException, .Statement, java.util.concurrent.ExecutionException, .ExecutorService, .Executors, .Future, org.h2.jdbc.JdbcConnection, org.h2.util.Tool

Creates a cluster from a stand-alone database. Copies a database to another location if required.

Field Summary

Inherited from org.h2.util.Tool:
out

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
execute(String
the database URL of the original database
urlSource
,
String
the database URL of the copy
urlTarget
,
String
the user name
user
,
String
the password
password
,
String
the server list
serverList
)

Creates a cluster.

public static void
main(String...
the command line arguments
args
)

Options are case sensitive.

private static void
performTransfer(Statement statSource, String urlTarget, String user, String password, String serverList)

private static void
process(String urlSource, String urlTarget, String user, String password, String serverList)

public void
runTool(String...
the argument list
args
)

Implements abstract org.h2.util.Tool.runTool.

Run the tool with the given output stream and arguments.

private static Future<?>
startWriter(final PipedReader pipeReader, final Statement statSource)

Inherited from org.h2.util.Tool:
getMainClassNameisOptionprintNoDatabaseFilesFoundsetOutshowUsageshowUsageAndThrowUnsupportedOptionthrowUnsupportedOption

Constructor Detail

CreateClusterback to summary
public CreateCluster()

Method Detail

executeback to summary
public void execute(String urlSource, String urlTarget, String user, String password, String serverList) throws SQLException

Creates a cluster.

Parameters
urlSource:String

the database URL of the original database

urlTarget:String

the database URL of the copy

user:String

the user name

password:String

the password

serverList:String

the server list

Exceptions
SQLException:
on failure
mainback to summary
public static void main(String... args) throws SQLException

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:String[]

the command line arguments

Exceptions
SQLException:
on failure
performTransferback to summary
private static void performTransfer(Statement statSource, String urlTarget, String user, String password, String serverList) throws SQLException
processback to summary
private static void process(String urlSource, String urlTarget, String user, String password, String serverList) throws SQLException
runToolback to summary
public void runTool(String... args) throws SQLException

Implements abstract org.h2.util.Tool.runTool.

Doc from org.h2.util.Tool.runTool.

Run the tool with the given output stream and arguments.

Parameters
args:String[]

the argument list

Annotations
@Override
Exceptions
SQLException:
on failure
startWriterback to summary
private static Future<?> startWriter(final PipedReader pipeReader, final Statement statSource) throws IOException