为什么我的代码未提示错误却没有运行结果
package com.imooc.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class JdbcImooc {
private static final String url = "jdbc:mysql://127.0.0.1:3306/imooc";
private static final String user = "root";
private static final String password = "123";
public static void main(String[] args) {
// TODO Auto-generated method stub
//1加载驱动程序
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//2.获得数据库连接
try {
Connection conn = DriverManager.getConnection(url, user, password);
//3.通过连接操控数据库进行增删改查
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select user_name, age from imooc_goddess");
while (rs.next()){
System.out.println(rs.getString("name")+","+rs.getInt("age"));
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
为什么我的什么也不显示