GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing university.voltdb.com — jdbcloader Using VoltDBjdbcloaderjdbcloader — Extracts a table from another database via JDBC and inserts it into a VoltDB table. Synopsisjdbcloader table-name [arguments] jdbcloader -p procedure-name [arguments] DescriptionThe jdbcloader command uses the JDBC interface to fetch all records from the specified table in a remote database and then insert those records into a matching table in VoltDB. The most common way to use jdbcloader is to copy matching tables from another database to VoltDB. In this case, you specify the name of the table, plus any JDBC-specific arguments that are needed. Usually, the required arguments are the JDBC connection URL, the source table, the username, password, and local JDBC driver. For example: $ jdbcloader employees \
--jdbcurl=jdbc:postgresql://remotesvr/corphr \
--jdbctable=employees \
--jdbcuser=charlesdickens \
--jdbcpassword=bleakhouse \
--jdbcdriver=org.postgresql.DriverIn addition to inserting all valid content into the specified database table, jdbcloader creates three output files:
All three files are created, by default, in the current working directory using "jdbcloader" and the table name as prefixes. For example, using jdbcloader to insert contestants into the sample voter database creates the following files:
It is possible to use jdbcloader to perform other input operations. For example, if the source table does not have the same structure as the target table, you can use a custom stored procedure to perform the necessary translation from one to the other by specifying the procedure name on the command line with the --procedure flag: $ jdbcloader --procedure translateEmpRecords \
--jdbcurl=jdbc:postgresql://remotesvr/corphr \
--jdbctable=employees \
--jdbcuser=charlesdickens \
--jdbcpassword=bleakhouse \
--jdbcdriver=org.postgresql.DriverArguments
ExampleThe following example loads records from the Products table of the Warehouse database on server hq.mycompany.com and writes the records into the Products table of the VoltDB database on servers svrA, svrB, and svrC, using the MySQL JDBC driver to access to source database. Note that the --jdbctable flag is not needed since the source and target tables have the same name. $ jdbcloader Products --servers="svrA,svrB,svrC" \
--jdbcurl="jdbc:mysql://hq.mycompany.com/warehouse" \
--jdbcdriver="com.mysql.jdbc.Driver" \
--jdbcuser="ceo" \
--jdbcpassword="headhoncho" | |||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |