62,634
社区成员




try{
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/opensource_students?useSSL=true&characterEncoding=UTF-8";
String user="root";
String password="";
conn=DriverManager.getConnection(url,user,password);
System.out.println("连接成功,喜大普奔");
String sql="select * from mess where number=00004";
// PreparedStatement ptmt=conn.prepareStatement(sql);
// ptmt.setString(1, number);
// ResultSet rs=ptmt.executeQuery();
Statement stat=conn.createStatement();
ResultSet rs=stat.executeQuery(sql);
String name=rs.getString("name");
System.out.println(name);
}catch(Exception e2){
System.out.println("又TM连接失败了");
}