servlet编程问题
这个程序错在哪里?为什么会连接不了数据库:try{
Class.forName("org.gjt.mm.mysql.Driver");
logconn=java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3307/lvddb","root","15186986877");
logStmt=logconn.createStatement(java.sql.ResultSet.TYPE_SCROLL_SENSITIVE,
java.sql.ResultSet.CONCUR_READ_ONLY);
strq="select user,password from lvduserdb";
logRst=logStmt.executeQuery(strq);
user2=logRst.getString("username");
pass2=logRst.getString("password");
if(user1.equals(user2)&&pass1.equals(pass2)){
RequestDispatcher dispatcher=request.getRequestDispatcher("asssportcom.jsp");
dispatcher.forward(request,response);
}else{
RequestDispatcher dispatcher=request.getRequestDispatcher("login.html");
dispatcher.forward(request,response);
}
}catch(SQLException e){
System.out.println(e.toString());
}catch(Exception e){
System.out.println(e.toString());
}
finally{
System.out.println("0");
}