假设数据库(mysql)具有以下数据:
+----+----------+------------+---------+------+------+------+
| id | username | birthday | address | age | mid | lid |
+----+----------+------------+---------+------+------+------+
| 1 | tom | 1536154211 | abc | 19 | NULL | 1 |
| 2 | Jan | 1536154211 | bdb | 12 | NULL | 2 |
| 3 | Xu | 1536154211 | aaa | 11 | NULL | 3 |
+----+----------+------------+---------+------+------+------+
如何像这样的语句转换表中的数据:
INSERT INTO `tb_user` VALUES (1, 'tom', 1536154211, 'abc', 19, NULL, 1);
INSERT INTO `tb_user` VALUES (2, 'Jan', 1536154211, 'bdb', 12, NULL, 2);
INSERT INTO `tb_user` VALUES (3, 'Xu', 1536154211, 'aaa', 11, NULL, 3);
JDBC或mysql怎么做
答案 0 :(得分:0)
这是我通过看别人得到的答案
mysqldump -uroot -p learn tb_user >dump.sql
但不完美,因为我想通过JDBC来实现