Commit f0da7c0a authored by Quxl's avatar Quxl

x

parent 799bbae7
......@@ -59,7 +59,7 @@ public class MysqlTo {
public void execute(String name, String comment) {
try {
String sql = "SELECT C.COLUMN_NAME, C.COLUMN_TYPE, C.COLUMN_COMMENT, CU.CONSTRAINT_NAME FROM COLUMNS C LEFT JOIN KEY_COLUMN_USAGE CU ON CU.TABLE_SCHEMA = C.TABLE_SCHEMA AND CU.TABLE_NAME = C.TABLE_NAME AND CU.COLUMN_NAME = C.COLUMN_NAME WHERE C.TABLE_SCHEMA = '" + db_name + "' AND C.TABLE_NAME = '" + name + "'";
String sql = "SELECT DISTINCT C.COLUMN_NAME, C.COLUMN_TYPE, C.COLUMN_COMMENT, CU.CONSTRAINT_NAME FROM COLUMNS C LEFT JOIN KEY_COLUMN_USAGE CU ON CU.TABLE_SCHEMA = C.TABLE_SCHEMA AND CU.TABLE_NAME = C.TABLE_NAME AND CU.COLUMN_NAME = C.COLUMN_NAME WHERE C.TABLE_SCHEMA = '" + db_name + "' AND C.TABLE_NAME = '" + name + "'";
System.out.println(sql);
ResultSet set = conn.prepareStatement(sql).executeQuery();
List<String> names = new ArrayList<String>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment