我用的平台是eclipse+tomcat,如何在这个平台上测试联接mysql数据库(是以JDBC的方式连接).
还有如果要使用Hibernate的方式那?

解决方案 »

  1.   

    先解决基本的连接数据库吧,Class.forName("org.gjt.mm.mysql.Driver").newInstance(); 
    String url ="jdbc:mysql://localhost/myDB?user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1" 
    //myDB为数据库名 
    Connection conn= DriverManager.getConnection(url); hibernate里有个hibernate.properties配置文件,在里面设置JDBC驱动和数据库帐号密码等等。