在Java中,下列选项可以正确获取结果集的是( )。
A.
Statement sta=con.createStatement();ResultSet rs=sta.executeQuery("select * from student");
B.
Statement sta=con.createStatement("select * from student");ResultSet rs=sta.executeQuery();
C.
Statement sta=con.prepareStatement("select * from student");ResultSet rs=sta.execute();
D.
Statement sta=con.prepareStatement();ResultSet rs=sta.execute ("select * from student");