try{
Class.forName("org.gjt.mm.mysql.Driver").newInstance();}catch(ClassNotFoundException e){
out.println(e.getMessage());
}catch(Exception e){
out.println(e.getMessage());
}try{
Connection con=DriverManager.getConnection("jdbc:MySql://localhost:3306/mydatatBase","username","pwd");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select topic_title from login");
out.println("<ul>");
while(rs.next()){
out.println("<li>"+rs.getString("username"));
}
out.println("</ul>");}catch(SQLException e){
out.println("SQLException:"+e.getMessage());
}
%>
Class.forName("org.gjt.mm.mysql.Driver").newInstance();}catch(ClassNotFoundException e){
out.println(e.getMessage());
}catch(Exception e){
out.println(e.getMessage());
}try{
Connection con=DriverManager.getConnection("jdbc:MySql://localhost:3306/mydatatBase","username","pwd");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select topic_title from login");
out.println("<ul>");
while(rs.next()){
out.println("<li>"+rs.getString("username"));
}
out.println("</ul>");}catch(SQLException e){
out.println("SQLException:"+e.getMessage());
}
%>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货