hibernate.connection.url=jdbc:mysql:///vms?这个有问题。不是什么ip地址啊。

解决方案 »

  1.   

    看看我的例子,我在本地的mysql有一个数据库filiation。
    hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
    hibernate.connection.driver_class org.gjt.mm.mysql.Driver
    hibernate.connection.driver_class com.mysql.jdbc.Driver
    hibernate.connection.url jdbc:mysql://localhost/filiation?useUnicode=true&characterEncoding=GBK
    hibernate.connection.username root
    hibernate.connection.password 
      

  2.   

    谢谢你的关心,我就是这样定义的,和你不同之处只有hibernate.connection.driver_class=com.mysql.jdbc.Driver
    我不知道这个有没有问题。我想知道环境变量要设置哪些,还有mysql驱动需要放到哪里?
    我觉得是配置的问题,因为我能够启动到登陆界面,能不能说说你的怎样配置的阿
      

  3.   

    你把这个属性换成我的试试呢。jdbc驱动放到tomcat_home\common\lib底下。不要放到webapp的web-inf/lib底下,可能会碰到问题。
      

  4.   

    例:
    ## MySQLhibernate.dialect net.sf.hibernate.dialect.MySQLDialect
    hibernate.connection.driver_class org.gjt.mm.mysql.Driver
    #hibernate.connection.driver_class com.mysql.jdbc.Driver
    hibernate.connection.url jdbc:mysql://localhost/hibernate?useUnicode=true&characterEncoding=GBK
    hibernate.connection.username root
    hibernate.connection.password 楼主将驱动放在classpath下或工程类路径下,如果是web应用,则放到webapp/web-inf/lib下