tList = new ArrayList();
try {
DatabaseMetaData dbmd = connection.getMetaData();
// 表名列表
String[] types = {"TABLE"};
ResultSet rest = dbmd.getTables(null, null, "%", types);
while (rest.next()) {
String tablename = rest.getString("TABLE_NAME");
//System.out.println(tablename);
tList.add(tablename);
}
for (String tn : tList) {
System.out.println(tn);
try {
resultSet = dbmd.getPrimaryKeys(null, null, tn);
while(resultSet.next()) {
String name = resultSet.getString("COLUMN_NAME");
System.out.println("Primykey Column name:" + name );
}
resultSet = dbmd.getIndexInfo(null, null, tn, false, false);
while (resultSet.next()) {
String name = resultSe