提交 4aa5308e 编写于 作者: S serge-rider

Schema gen test fix


Former-commit-id: 18823797
上级 135a74b6
......@@ -7,24 +7,29 @@ public class HugeTableGenerator {
public static void main(String[] args) throws SQLException {
final String url = "jdbc:oracle:thin:@127.0.0.1:1521:ORCL";
// final String url = "jdbc:oracle:thin:@127.0.0.1:1521:ORCL";
// final Properties props = new Properties();
// props.setProperty("user", "sys as sysdba");
// props.setProperty("password", "");
final String url = "jdbc:mysql://localhost:3306/test";
final Properties props = new Properties();
props.setProperty("user", "sys as sysdba");
props.setProperty("password", "cityman");
props.setProperty("user", "root");
props.setProperty("password", "");
try (Connection conn = DriverManager.getConnection(url, props)) {
conn.setAutoCommit(true);
try (PreparedStatement stmt = conn.prepareStatement(
"CREATE TABLE BigTable (table_key integer, some_string varchar(64), create_time timestamp, primary key(table_key))"))
"CREATE TABLE test.BigTable (table_key integer, some_string varchar(64), create_time timestamp, primary key(table_key))"))
{
stmt.execute();
}
// 10kk records
conn.setAutoCommit(false);
try (PreparedStatement stmt = conn.prepareStatement(
"INSERT INTO BigTable(table_key, some_string, create_time) values(?,?,?)")) {
for (int i = 0; i < 10000000; i++) {
"INSERT INTO test.BigTable(table_key, some_string, create_time) values(?,?,?)")) {
for (int i = 0; i < 20000000; i++) {
stmt.setInt(1, i);
stmt.setString(2, "Row " + i);
stmt.setTimestamp(3, new Timestamp(System.currentTimeMillis()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册