这是显示错误的代码:这是连接我的测试数据库并在其中创建名为 r 的表的 Netbeans 代码
try{
Class.forName("java.sql.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/test","root","tiger");
Statement stmt =con.createStatement();
String query = "create table r(s int);";
ResultSet rs = stmt.executeQuery(query);
this.dispose();
roll second = new roll();
second.setVisible(true);
} catch (Exception e) {
lbl1.setText("Error1 in database connectivity");
}