public class BankAccountFiller extends java.lang.Object implements DBFiller
Modifier and Type | Field and Description |
---|---|
private static int |
ACCOUNT_EXTRA
Number of extra bytes needed to make the rows in the account
table at least 100 bytes, as required by the TPC-B spec.
|
(package private) static java.lang.String |
ACCOUNT_TABLE
Name of the account table.
|
private int |
accountsPerBranch
Number of accounts per branch.
|
private static int |
BRANCH_EXTRA
Number of extra bytes needed to make the rows in the branch
table at least 100 bytes, as required by the TPC-B spec.
|
(package private) static java.lang.String |
BRANCH_TABLE
Name of the branch table.
|
private int |
branches
Number of records in the branch table.
|
(package private) static int |
DEFAULT_ACCOUNTS_PER_BRANCH
The number of accounts per branch, if not specified.
|
(package private) static int |
DEFAULT_TELLERS_PER_BRANCH
The number of tellers per branch, if not specified.
|
(package private) static int |
HISTORY_EXTRA
Number of extra bytes needed to make the rows in the history
table at least 50 bytes, as required by the TPC-B spec.
|
(package private) static java.lang.String |
HISTORY_TABLE
Name of the history table.
|
private static int |
TELLER_EXTRA
Number of extra bytes needed to make the rows in the teller
table at least 100 bytes, as required by the TPC-B spec.
|
(package private) static java.lang.String |
TELLER_TABLE
Name of the teller table.
|
private int |
tellersPerBranch
Number of tellers per branch.
|
Constructor and Description |
---|
BankAccountFiller(int scale)
Create a filler that generate tables which have correct sizes
relative to each other.
|
BankAccountFiller(int branches,
int tellersPerBranch,
int accountsPerBranch)
Create a filler that generates tables with the given sizes.
|
Modifier and Type | Method and Description |
---|---|
(package private) static java.lang.String |
createJunk(int length)
Return a string of the specified length that can be used to
increase the size of the rows.
|
private static void |
createTables(java.sql.Connection c)
Create the tables.
|
private static void |
dropTables(java.sql.Connection c)
Drop the tables if they exits.
|
void |
fill(java.sql.Connection c)
Populate the database.
|
private void |
fillTables(java.sql.Connection c)
Fill the tables with rows.
|
static final java.lang.String ACCOUNT_TABLE
static final java.lang.String BRANCH_TABLE
static final java.lang.String TELLER_TABLE
static final java.lang.String HISTORY_TABLE
static final int DEFAULT_TELLERS_PER_BRANCH
static final int DEFAULT_ACCOUNTS_PER_BRANCH
private static final int ACCOUNT_EXTRA
private static final int BRANCH_EXTRA
private static final int TELLER_EXTRA
static final int HISTORY_EXTRA
private final int branches
private final int tellersPerBranch
private final int accountsPerBranch
public BankAccountFiller(int branches, int tellersPerBranch, int accountsPerBranch)
branches
- number of branchestellersPerBranch
- number of tellers per branchaccountsPerBranch
- number of accounts per branchpublic BankAccountFiller(int scale)
scale
- the scale factor for this databasepublic void fill(java.sql.Connection c) throws java.sql.SQLException
private static void dropTables(java.sql.Connection c) throws java.sql.SQLException
java.sql.SQLException
private static void createTables(java.sql.Connection c) throws java.sql.SQLException
java.sql.SQLException
private void fillTables(java.sql.Connection c) throws java.sql.SQLException
java.sql.SQLException
static java.lang.String createJunk(int length)
length
- the length of the stringApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.