This commit is contained in:
zyyang 2021-01-17 16:50:16 +08:00
parent 10b1d91070
commit 34a8cbb4cc
1 changed files with 17 additions and 0 deletions

View File

@ -35,6 +35,23 @@ public class StatementTest {
statement.executeUpdate("drop database if exists " + dbName);
}
@Test
public void testCase() {
try {
ResultSet rs = statement.executeQuery("show databases");
ResultSetMetaData metaData = rs.getMetaData();
while (rs.next()) {
for (int i = 1; i <= metaData.getColumnCount(); i++) {
System.out.print(metaData.getColumnLabel(i) + ":" + rs.getString(i) + "\t");
}
System.out.println();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
@Test
public void createTableAndQuery() throws SQLException {
long ts = System.currentTimeMillis();