public class DBUtil {
private static final String URL="jdbc:mysql://localhost:3306/test";
private static final String NAME="root";
private static final String PASSWORD="1234";
public static void main(String[] args) throws ClassNotFoundException, SQLException {
Class.forName("com.mysql.jdbc.Driver");
Connection c=DriverManager.getConnection(URL,NAME,PASSWORD);
Statement s=c.createStatement();
ResultSet rs=s.executeQuery("select user_name from goddess");
System.out.println(rs.getString("user_name")+","+rs.getInt("age"));
System.out.println("adfasf");
}
}
没有报错,也没有任何文字输出