解决方案 »

  1.   

    怎么驱动注释掉了,mysql的连接 也没用 url ,user,password.
    先在后台java做下测试能否连上,然后在从页面测试。
      

  2.   

    proxool.DB里面有用户名和密码,不过我可以想办法做个单机版的试试。谢谢
      

  3.   

    有几个初级问题:
    1. 用不用编译?
    2. 单机版启动时指定一个文件,web版的怎么启动?
    3. e.printStackTrace()等异常信息在什么地方显示。
      

  4.   

    需要编译。
    web 版你的代码在容器里被加载、初始化。
    e.printStackTrace() 等异常信息还是在控制台显示呀。
      

  5.   

    楼主是还没有把项目运行起来么?
    先部署这个项目,然后启动tomcat
      

  6.   

    浏览器中输入http:\\localhost:8080能运行,但是myeclips中设的断点不起作用,没有中断,不知道怎么操作,不知道具体怎么操作。好像浏览器和myeclips没有联系到一起。
      

  7.   

    访问http:\\localhost:8080只能说明你的应用服务器tomcat已经安装好了,项目没有部署到tomcat中吧
      

  8.   

    // 此方法为获取数据库连接
    public static Connection getConnection() {
    Connection conn = null;
    try {
    String driver = "com.mysql.jdbc.Driver"; // 数据库驱动
    String url = "jdbc:MySQL://127.0.0.1:3306/itopo";// 数据库
    String user = "itopo"; // 用户名
    String password = "itopo"; // 密码
    Class.forName(driver); // 加载数据库驱动 if (null == conn) {
    Class.forName(driver); // 加载数据库驱动
    System.out.println("Sorry,can't find the Driver!");
    conn = DriverManager.getConnection(url, user, password);
    }
    } catch (ClassNotFoundException e) {
    System.out.println("Sorry,can't find the Driver!");
    e.printStackTrace();
    } catch (SQLException e) {
    e.printStackTrace();
    } catch (Exception e) {
    e.printStackTrace();
    } return conn;
    }写个主函数测试一下:
    // 主函数用于测试数据库连接
    public static void main(String[] args) {
    try {
    DBUtil.getConnection();//DBUtil是你的类名
    System.out.println("SUCCESS");
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    System.out.println("ERROR");
    }
    }
      

  9.   

    你可能是myeclipse 和tomcat 都没有建立联系。
    也就是你的tomcat下的项目都没有部署好吧!
    正常配置OK的话,你是可以在连接数据库之前就可以跟踪代码了!
      

  10.   

    http://goobbe.com/questions/1596462/getting-stacktrace-in-logger