public class MysqlClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
QUEUE_DEFAULT_SIZE |
static int |
RANDOM_INT_RANGE |
static long |
RANDOM_LONG_RANGE |
| Constructor and Description |
|---|
MysqlClient(MysqlConf conf)
connect the mysql server using jdbc
|
| Modifier and Type | Method and Description |
|---|---|
MyData |
desc(String tbName)
desc table structure
|
void |
execute(String sql)
execute update delete or insert
|
void |
executeBatch(List<String> sqls)
execute batch
|
MyData |
getMyData() |
boolean |
isDataQueueEmpty() |
List<MyData> |
query(String sql)
query from sql , receive list MyData
|
void |
queryAsync(String sql)
query sql retrieve data into queue
|
void |
rdInsert(String tb,
int count)
random insert with table name
|
void |
setBatchSize(int batchSize)
set batch size
|
public static final int QUEUE_DEFAULT_SIZE
public static final long RANDOM_LONG_RANGE
public static final int RANDOM_INT_RANGE
public void execute(String sql)
sql - Exceptionpublic void executeBatch(List<String> sqls)
sqls - Exceptionpublic void rdInsert(String tb, int count) throws Exception
tb - count - Exceptionpublic List<MyData> query(String sql) throws Exception
sql - Exceptionpublic void queryAsync(String sql) throws Exception
sql - Exceptionpublic MyData desc(String tbName) throws Exception
tbName - Exceptionpublic void setBatchSize(int batchSize)
batchSize - public boolean isDataQueueEmpty()
Copyright © 2016. All rights reserved.